将下一个和上一个附加到单选按钮
我已经被代码困扰了几天,我真正想做的是在单选按钮上附加 NEXT 和 PREVIOUS (链接/按钮)。
<div id="slides">
<ul class="options-list">
<li>
<input type="radio" class="getradiotomove" id="bundle-73" name="bundle_option" value="73">
<input type="radio" class="getradiotomove" id="bundle-72" name="bundle_option" value="72">
<input type="radio" class="getradiotomove" id="bundle-74" name="bundle_option" value="74">
</ul>
</div>
<div id="buttons">
<a href="#" id="prev">prev</a>
<a href="#" id="next">next</a>
<div class="clear"></div>
</div>
我在这里想做的是,当我单击“下一步”时,它将选择其下面的单选按钮,因此上面的代码有bundle-73、bundle-72和bundle-74,表示如果默认选择的是bundle- 73,当我点击下一步时,它应该选择bundle-72。
I have been stuck with a code for a few days, and what I'm really trying to do is to append NEXT and PREVIOUS (link/button) on a radio button.
<div id="slides">
<ul class="options-list">
<li>
<input type="radio" class="getradiotomove" id="bundle-73" name="bundle_option" value="73">
<input type="radio" class="getradiotomove" id="bundle-72" name="bundle_option" value="72">
<input type="radio" class="getradiotomove" id="bundle-74" name="bundle_option" value="74">
</ul>
</div>
<div id="buttons">
<a href="#" id="prev">prev</a>
<a href="#" id="next">next</a>
<div class="clear"></div>
</div>
what I am trying to do here is that, when i click on next, it will select the radio button below it, so the code above has bundle-73, bundle-72 and bundle-74, says if the default selected is bundle-73, when i click next, it should select bundle-72.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您的 HTML 看起来已损坏,所以我假设您的意思是这样的:
那么您的下一个操作将如下所示:
演示:http://jsfiddle.net/ambigously/hTgv3/1/
这假设您只有一组单选按钮。
您应该能够自己解决之前的操作。
参考文献:
:checked
选择器索引
函数Your HTML looks broken so I'm going to assume you really mean this:
Then your next action would look like this:
Demo: http://jsfiddle.net/ambiguous/hTgv3/1/
This assumes that you only have the one group of radio buttons.
You should be able to sort out the previous action yourself.
References:
:checked
selectorindex
function也许是这样的?
和 JavaScript:
Maybe somethining like this?
and javascript: