View Full Version : ContentEditable execCommand() alternative?
fluid
Apr 17th 2006, 11:18 am
I have a contenteditable div on a page. I know there are a few in-built functions (execCommand()) which i can use but i need to be able to insert H5 tags in the contenteditable. So my question is how do i create a custom execCommand to do the H5 for my page. Or any other alternative?
torunforever
Apr 17th 2006, 12:57 pm
Maybe I'm misunderstanding what you're asking, but have you tried this?
yourObj.execCommand('formatblock', false, '<h5>')
fluid
Apr 18th 2006, 3:10 am
What i really want to do is <h5 class=myclass>my text</h5>.
I tried yourObj.execCommand('formatblock', false, '<h5 class=myclass>') but it doesnt work. Any ideas?
fluid
Apr 19th 2006, 2:07 am
Alrite, i found solution to this.
Just one little javascript function was enough to do it.
getElementsByTagName()
setAttribute()
thanks anyway torunforever
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.