I am using JavaScript to assign a value to an empty div through document.getElementById('').innerHTML which works fine and I can see the words update and come up on the browser. I then try to capture those words but keep getting it as undefined.
My HTML is
<div id="name"> </div>
JavaScript executes this:
function doneloading(first_name) {
document.getElementById('name').innerHTML = first_name;
}
I try to capture that using:
var photoname = document.getElementById('name').value;
alert(photoname);
Is it not possible to capture innerHTML in general?? Thanks in advance!
innerHTMLproperty, but retrieving thevalueproperty. You should try to retrieve theinnerHTMLproperty.