What's the difference between document.getElementById(“test”).value and document.getElementById(“test”)[removed]

后端 未结 5 1879
心在旅途
心在旅途 2021-01-01 00:37
document.getElementById(\"test\").value

document.getElementById(\"test\").innerHTML

Does the first mean the address and the second mean the value

5条回答
  •  难免孤独
    2021-01-01 01:15

    some HTML elements have an attribute "value", such as some others don't have it.

    if you want to modify them, you may use the DOM attribute (used with Javascript) innerHTML (if they have any). this attribute represents the content of an element, so it may be used for elements accepting to nest other element such as

    ,

提交回复
热议问题