Home > Article > Web Front-end > Three ways for js jquery to get server controls with randomly generated IDs_jquery
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();