i have a div with contenteditable="true"
that im using in place of textarea
using jQuery, i cant seem to capture its val()
heres my fiddle
thanks
Some general tips even if you got the answer
.val() = getting value from elements like text,textarea,select,checkbox
.text() = getting text values(excludes html tags) from elements like text,textarea,select,checkbox
.html() = getting html content from elements like span,div p table..etc..
Examples
<input type="text" id="someid" value="1234" />
$('#someid').val(); //1234
<p>bla bla bla<span>hello</span></p>
$('p').text(); //bla bla bla
$('p').html(); //bla bla bla<span>hello</span>
With it being a div
, you would grab the .text()
.
Fiddle: http://jsfiddle.net/jPD7y/4/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With