java脚本函数getElementById()的工作原理是什么 [英] what is the work of java script function getElementById()

查看:88
本文介绍了java脚本函数getElementById()的工作原理是什么的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

java脚本函数的工作是什么getElementById()

what is the work of java script function getElementById()

推荐答案

http://msdn.microsoft.com/en-us/library/ms536437(v = vs.85).aspx [ ^ ]

http://www.w3schools.com/jsref/met_doc_getelementbyid.asp [ ^ ]


<input id="btnok" type="button" value="button" />
<input id="Button1" type="button" value="button" />
<div id="div1" />
<div id="div2" />
<script type="text/javascript">
 
document.getElementById("btnok").value; //It works on only that element which match the id with "btnok" or you can say      works on unique Id.


document.getElementsByTagName("div").length; //It works on all  that element which have the tag name "div"  
   
   </script>


我认为这个链接 [ ^ ]将为您提供帮助。
I think this link[^] will help you.


这篇关于java脚本函数getElementById()的工作原理是什么的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆