.net JS获取控件ID

来源:互联网 发布:有没有自动关机软件 编辑:程序博客网 时间:2024/05/16 19:41

 前台:

     <input name="lastname" id="lastname" type="text" style="width: 200px" />

    <input name="txtTags" runat="server" id="txtTags" type="text" style="width: 200px"   />

JS: 

 var txtLastName = document.getElementById("lastname");

 var txtTags = document.getElementById("ctl00_ContentPlaceHolder1_txtTags");