Use of document.getElementById in JavaScript

后端 未结 7 1007
后悔当初
后悔当初 2021-02-06 08:31

Can someone explain what the document.getElementById(\"demo\") line does in the example below?

I understand getElementById gets the id of demo but the id is

7条回答
  •  北恋
    北恋 (楼主)
    2021-02-06 09:22

    It is just a selector that helps you select specific tag

    elements which help you change the behavior, in any event (either mouse or keyboard).

提交回复
热议问题