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?
Maybe I'm misunderstanding what you're asking, but have you tried this? yourObj.execCommand('formatblock', false, '<h5>')
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?
Alrite, i found solution to this. Just one little javascript function was enough to do it. getElementsByTagName() setAttribute() thanks anyway torunforever