我是jQuery的新手,并认为我会使用它的按钮集而不是我的应用程序上的某些单选按钮。这里的文档:http://jqueryui.com/demos/button/#radiojQuery按钮组更改
当一组按钮更改值时,如何向事件添加处理程序?
这里是我试过的代码片段:
$('input.tod_quant').change(function() {
alert('TEST');
});
在HTML
再后来就:
<span id="tod_quant" class="buttonset">
<input type="radio" id="tod_quant5" name="tod_quant" value="5" /><label for="tod_quant5">5-Minute</label>
<input type="radio" id="tod_quant60" name="tod_quant" checked="checked" value="60" /><label for="tod_quant60">60-Minute</label>
</span>
的 “改变” 事件永远不会触发。是否有变化事件?我怎样才能做到这一点?此外,有没有例子的文档? http://jqueryui.com有很多例子,并且我没有发现任何可以显示任何事件发生的例子。我想我对jQuery的无知并不完全有助于这种情况。
任何帮助将不胜感激。谢谢。
当我写同样的东西时,你的答案闪现了! – 2011-03-21 03:27:29