[英]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.