嗨,我开始编码,并坚持使用类似的东西:
<form>
<input type="radio" name="liczba" value="1" /> Jedno pokolenie (3 PT)<br/>
<input type="radio" name="liczba" value="2" /> Dwa pokolenia (5 PT) <br/>
<input type="radio" name="liczba" value="3" /> Trzy pokolenia (7 PT) <br/>
<form>
<div id="Generator_Nemuraj" class="button"><br/> <p>Generuj </p></div>
我尝试使用以下代码获取所选无线电的值:
<script type="text/javascript">
$(document).ready(function () {
$('#Generator_Nemuraj').click(function () {
alert("klik");
var val = $('input:radio[name=liczba]:checked').val();
alert(val);
});
});
</script>
请帮助:)