Home > Web Front-end > JS Tutorial > jQuery gets the radio button selected value and removes all radio selected status examples to share

jQuery gets the radio button selected value and removes all radio selected status examples to share

小云云
Release: 2018-01-11 13:57:37
Original
3361 people have browsed it

This article mainly brings you a jQuery method to obtain the radio selected value of a radio button and remove all radio selected states. I hope it can help you.

As shown below:

喜欢<input type="radio" name="likea" id="" value="3" /> 
一般<input type="radio" name="likea" id="" value="2" /> 
不喜欢<input type="radio" name="likea" id="" value="1" />
Copy after login

Use jQuery to get the radio selected value

$("input[name='likea']:checked").val()
Copy after login

Remove all radio selected states

$('input:radio[name="likea"]').removeAttr('checked');
Copy after login

Related recommendations:

jQuery implements RadioButton to do the required verification function method sharing

How to use radio in html

input attribute radio The problem of setting checked in does not take effect

The above is the detailed content of jQuery gets the radio button selected value and removes all radio selected status examples to share. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template