I have several textboxes
with the class output
. I would like to be able to print their values as a plain HTML list in a div
with ID
combined
. Right now, I have the following code:
function doCombine() {
document.getElementById('combined').innerHTML =
document.getElementsByClassName('output').value + ",";
}
Yet, when I run the function, i get the error message undefined
,. When i add a [0]
before .value
, it works, but only the value of the first textbox
is showing up. I read somewhere that [i]
will show all the values, but that doesn't seem to work.
What am I doing wrong?