Home  >  Article  >  Web Front-end  >  jquery gets the value and text value of ASP.NET server-side controls dropdownlist and radiobuttonlist after generating client HTML tag_jquery

jquery gets the value and text value of ASP.NET server-side controls dropdownlist and radiobuttonlist after generating client HTML tag_jquery

WBOY
WBOYOriginal
2016-05-16 18:24:201204browse

—Get the text of the dropdownlist (ddlList is the ID of the server-side dropdownlist, and generates a select tag with a name attribute equal to ddlList)

 $("#ddlList option:selected").text()

2. Get the value of the dropdownlist (ddlList is the ID of the server-side dropdownlist, and generate a select tag with a name attribute equal to ddlList)

 $("#ddlList").val()

3. Get The text of the radiobuttonlist (rbtList is the ID of the server-side radiobuttonlist, generating a set of input labels whose name attribute is equal to rbtList)

 $("input[name='rbtList']:checked label").text()

4. Get the value of radiobuttonlist (rbtList is the ID of the server-side radiobuttonlist, and generate a set of input tags with a name attribute equal to rbtList)

 $("input[name='rbtList']:checked ").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