开发者

javascript-getelement

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜