I am new to Daniweb, but I have browsed the forum here for a while and it has often solved problems of mine, so now that I encountered a pickle which I cannot seem to solve in a satisfactory way using only googling, I'm asking for some hands on help:
While I am an amateur beginner when it comes to JavaScript, I feel that I can at least handle the scripting language to a level which suits my needs, however earlier today a friend asked me if I could lead her to the right direction with a class task of hers. Basically, the project at hand is to create a snippet of JavaScript which, when the user clicks the content of an HTML paragraph element, should replace said paragraph with a <textarea> and allow the user to alter the paragraph's content. Of course the textarea should be accompanied by a save and a cancel button, but seeing as it is a JavaScript class she's taking, the saving shall only be client-sided.
However, the catch is that she will not be allowed to use the innerHTML property.
So, to the question: how would one go (if it is possible, but I highly doubt it isn't) with making something like
var x = document.getElementById("id").innerHTML;
work the very same way, just not using innerHTML?
PS. I do feel this could be done in a more smooth looking and operating way by using the contentEditable attribute, but apparently the teacher asked for a textarea.
Thanks in advance for any help or constructive comments,
Jakob