I have a very common question: I want to get the value of HTML input using a jQuery selector with its name and a specific attribute, for example, marked. Here is my case:
<input type="radio" name="gender" value="man" checked="checked" /> <input type="radio" name="gender" value="women"/>
I tried the following code:
var gener = $("name='gender':checked=checked").val();
But he did not return the correct value. Hope someone helps me. Thanks.
source share