开发者

javascript-getelement

开发者 https://www.devze.com 2023-01-07 01:43 出处:网络
what type of values given to get开发者_高级运维ElementById() methodgetElementById expects a string.

what type of values given to get开发者_高级运维ElementById() method


getElementById expects a string.

The following code:

var element = document.getElementById('myId');

finds the following element and assigns it to element

<div id="myId"></div>


just pass the id of any element like <input type="text" id="text" /> just use getElementById("text")


a single DOM object, of a specialized class depending on the nature of the element identified by the given ID

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号