Monday, June 3, 2024
 Popular · Latest · Hot · Upcoming
13
rated 0 times [  17] [ 4]  / answers: 1 / hits: 31850  / 9 Years ago, fri, april 3, 2015, 12:00:00

I'm trying to catch the value inside this div, which is editable:



<div class=editable-div contentEditable=true>Hey</div>


I figured I could do this simply via JavaScript:



var changedText = $('.editable-div').innerHtml


However, this variable will always return undefined, which confuses me.



Can someone enlighten me on how to reach this value?


More From » jquery

 Answers
25

It is jQuery - you have to use:



$('.editable-div').html()

[#67206] Wednesday, April 1, 2015, 9 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
dylondarrianb

Total Points: 48
Total Questions: 109
Total Answers: 104

Location: Zambia
Member since Thu, Jun 25, 2020
4 Years ago
;