JSFiddle - React, Tailwind, and code Playground
by Rapha Souza
HTML
<script src="https://code.jquery.com/jquery-3.4.1.slim.js"></script>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.0/umd/popper.js"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.js"></script>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.css">
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>jQuery Get Selected Radio Button Value</title>
<script src="https://code.jquery.com/jquery-1.12.4.min.js"></script>
<script>
function notaLancada(){
var radioValue = $("input[name='radioLancarNotaWinthor']:checked").val();
if(radioValue){
alert("Your are a - " + radioValue);
}
}
</script>
</head>
<body>
<h4>Please select your gender.</h4>
<p>
<div class="form-group col-md-2" onclick="notaLancada()">
<label>Nota Lançada?</label>
<div class="input-group">
<input type="radio" id="radioLancarNotaWinthorSim" name="radioLancarNotaWinthor" value="sim" />
Sim<br>
<input type="radio" id="radioLancarNotaWinthorNao" name="radioLancarNotaWinthor" value="nao" />
Não<br>
</div>
</div>
</p>
<p><input type="button" value="Get Value"></p>
</body>
</html>
CSS
.row {
background: #f8f9fa;
margin-top: 20px;
}
.col {
border: solid 1px #6c757d;
padding: 10px;
}