Home >Web Front-end >JS Tutorial >jQuery gets the radio button selected value and removes all radio selected status examples to share
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" />
Use jQuery to get the radio selected value
$("input[name='likea']:checked").val()
Remove all radio selected states
$('input:radio[name="likea"]').removeAttr('checked');
Related recommendations:
jQuery implements RadioButton to do the required verification function method sharing
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!