1 <input type=”text”id=”id1”value=”hello”>this is id</input>
2 document.getElementById().value = hello 
3 document.getElementById().innerHTML = this is id

延伸:分别在什么场合用?

——文本域(font,div,table等)用innerHTML,元素(checkbox,radio,text等)用value。

相关文章:

  • 2021-05-26
  • 2022-02-05
  • 2022-02-13
  • 2022-01-05
  • 2022-12-23
  • 2018-08-20
  • 2022-12-23
猜你喜欢
  • 2022-01-29
  • 2021-10-10
  • 2022-12-23
  • 2021-06-03
  • 2021-11-22
  • 2022-12-23
相关资源
相似解决方案