Home >Web Front-end >JS Tutorial >jQuery's method of obtaining selected content and setting element attributes_jquery

jQuery's method of obtaining selected content and setting element attributes_jquery

WBOY
WBOYOriginal
2016-05-16 16:42:121260browse

Get selected selection:

$("#id option:selected").val();

Custom radio:

$("input[name=sex][value="+data.sex+"]").attr("checked",true);

Get radio:

$("input[name='sex']:checked").val()

Set input cannot be edited:

$("#cashNum").attr("disabled","disabled");

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