我有一个单选按钮组,我想选择旁边一个。
$(document).ready(function() {
$('.next').click(function() {
$("input[name=choice]:checked").next().click();
});
});
.button {
display: inline-block;
padding: 1em;
margin: 20px;
border: 1px solid black;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<input type="radio" id="choise_1" name="choice" checked="checked" />
<label for="choise_1">One</label>
<input type="radio" id="choise_2" name="choice" />
<label for="choise_2">Two</label>
<input type="radio" id="choise_3" name="choice" />
<label for="choise_3">Three</label>
<div class="button next">SELECT NEXT</div>
这就是我所拥有但不起作用