<input type="radio" name="teste1" value="SIM"> TESTE 1
<input type="radio" name="teste1" value="NÃO"> TESTE 2
$(document).ready(function(){
$("[name='teste1']").click(function () {
var teste = $(this+":checked").val();
alert(teste);
});
});
How to get the value using $ (this) + checked?
if($("[name='teste1']").is(":checked")){
var teste = $(this+":checked").val();
alert(teste);
}
is giving error: link
I would like to know how to use the :checked
selector, when this
is already the selector.