当我使用J Query在asp.net中单击此文本框时选择文本框值 [英] Select text box value when I click on this text box in asp.net using J Query
本文介绍了当我使用J Query在asp.net中单击此文本框时选择文本框值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好我想在使用j查询在asp.net中单击此文本框时从文本框中选择所有值。与windows应用程序相同,textbox有一个属性,即txtName.SelectAll()我想在ASP.Net中使用相同的功能。
请帮帮我
Hello everybody I want to select all value from textbox when I click on this textbox in asp.net using j query. Same as windows application there is one property for textbox which is txtName.SelectAll() I want to use same functionality in ASP.Net.
Please help me
推荐答案
试试这个(txtID是你的控制ID):
Try this (txtID is your control ID):
function selectAll(txtID) {
(txtID).setSelectionRange( 0 ,
(txtID).setSelectionRange(0,
(txtID).val()。length)
}
(txtID).val().length) }
下次在询问之前搜索解决方案很容易找到答案。
如果这有帮助请花时间接受解决方案。谢谢。
Next time search for the solution before asking for easily found answers.
If this helps please take time to accept the solution. Thank you.
这篇关于当我使用J Query在asp.net中单击此文本框时选择文本框值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文