【发布时间】:2012-11-27 05:48:44
【问题描述】:
jQuery UI 似乎对组成小部件的元素的属性很敏感。那么如何在单个页面\表单中多次使用相同的小部件?
示例 - 收音机选择小部件,它包含在使用 jQuery-ui 下载的演示 index.html 文件中:
<!DOCTYPE html>
<html>
<head>
...
$(function(){
$("#radioset").buttonset();
}
...
</head>
<body>
...
<form style="margin-top: 1em;">
<div id="radioset">
<input type="radio" id="radio1" name="radio" /><label for="radio1">Choice 1</label>
<input type="radio" id="radio2" name="radio" checked="checked" /><label for="radio2">Choice 2</label>
<input type="radio" id="radio3" name="radio" /><label for="radio3">Choice 3</label>
</div>
</form>
...
</body>
</html>
然后我应该添加什么代码来获得带有不同单选按钮集的第二个 div?
【问题讨论】:
标签: jquery-ui radio-button widget