Yeats Yeats - 5 months ago 5
Javascript Question

Why is innerHTML returning 'undefined'?

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"?


It is jQuery - you have to use: