I'd like to get the outer HTML and the inner value for a textarea element.
So, say I have the text "Lorem Ipsum" in a textarea, like so:
<textarea id="thing">Lorem Ipsum</textarea>
and I try to get it with the following:
textarea = document.getElementById('thing'); textareaNode = new CKEDITOR.dom.element(textarea); textareaNode.getOuterHtml(); // Returns '<textarea id="thing"></textarea>' textareaNode.getValue(); // Returns 'Lorem Ipsum'
Is there a good way to get the entire textarea HTML with the enclosed value? Ideally, I'd like to get the following:
<textarea id="thing">Lorem Ipsum</textarea>
If I've overlooked something as easy as
textareaNode.getHtmlWithValue()
or something like that, I apologize and please point me to it.
Thanks!
My current solution is this:
My current solution is this:
And it works okay.