M
MC
Hi,
I am trying to process all of the input values in a form into the innerHTML.
When I set the following for input elements, it goes into an endless loop. I
have debugged in Firefox and can see it but not why. It acts like its
inserting a new input element instead of putting a value into it.
Any ideas?
function doText(myForm) {
var e, i = 0;
while (e = myForm.elements[i++]) {
if (e.type == 'text') e.innerHTML = e.value;
}
}
Thank you,
MC
This is from an example at
http://www.tizag.com/javascriptT/javascript-innerHTML.php "Updating text
based on user input"
I am trying to process all of the input values in a form into the innerHTML.
When I set the following for input elements, it goes into an endless loop. I
have debugged in Firefox and can see it but not why. It acts like its
inserting a new input element instead of putting a value into it.
Any ideas?
function doText(myForm) {
var e, i = 0;
while (e = myForm.elements[i++]) {
if (e.type == 'text') e.innerHTML = e.value;
}
}
Thank you,
MC
This is from an example at
http://www.tizag.com/javascriptT/javascript-innerHTML.php "Updating text
based on user input"