How can I use innerhtml in JavaScript?

前端 未结 4 2063
无人及你
无人及你 2020-12-17 17:37

My problem is that I don\'t know how to show the innerhtml of my form.

The form is like a survey form and once you clicked the submit button, all the contents I had

4条回答
  •  时光取名叫无心
    2020-12-17 18:41

    Instead of this:

    var maincontent = document.getElementById("content").innerHTML;
    maincontent = "

    " + first;`

    Try this:

    document.getElementById("content").innerHTML = "

    " + first;

    You may also want to use .innerHTML to get 'first', rather than .value? I'm not sure what kind of element 'first' is.

提交回复
热议问题