Home  >  Article  >  Web Front-end  >  Three ways for js jquery to get server controls with randomly generated IDs_jquery

Three ways for js jquery to get server controls with randomly generated IDs_jquery

WBOY
WBOYOriginal
2016-05-16 17:29:071119browse

Since the server control will randomly generate the client ID after the ASP.NET web page is run, it is not easy to use jquery to obtain it. I googled it and found the following three methods:

Server control code:

1. $("#").val();

2. $("input[id*=txtUserID]").val();

3. $("*[id$=txtUserID]").val();

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn