[英]how to set focus for label when click the any button using javascript
我的aspx页面中有一个asp:Textbox和一个asp:label控件。 我想在使用javascript单击按钮时为标签设置焦点。 谁能告诉我该怎么做?
非常感谢...
for
属性为您提供了开箱即用的功能
<label for="{the id you want}"> </label>
因为它是asp.net应用程序,所以您需要使用ClientID
:
<label for='<%= myTextBox.ClientID %>'> </label>
use `.focus()` it will do the focus part
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.