contentEditable

T

trevordixon

I have an DIV with the contentEditable attribute. How can I get the
value of the content within that DIV after the user has edited it for
further processing. I'd like to store the HTML code within the DIV to a
hidden INPUT. Thanks for your help!
 
E

Evertjan.

wrote on 27 aug 2005 in comp.lang.javascript:
I have an DIV with the contentEditable attribute. How can I get the
value of the content within that DIV after the user has edited it for
further processing. I'd like to store the HTML code within the DIV to a
hidden INPUT. Thanks for your help!

<div id=d contentEditable>
....
<input type=hidden id=p>
....


function ... {

document.getElementById('p').value =
document.getElementById('d').innerHTML

}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,128
Latest member
ElwoodPhil
Top