我尝试设置/更改标准单选按钮到jquery(看起来像一个按钮) 但在某些页面工作正常,但现在我有问题:
SCRIPT438: Object doesn't support property or method 'buttonset'
<script>
$(document).ready(function () {
$(function(){$("#new1").buttonset()
});
});
</script>
我的身体部位是:
<body>
<div id="new1">
<input type="radio" id="return1" name="radio"><label for="return1">Name</label>
<input type="radio" id="return2" name="radio" checked="checked"><label for="return2">Surname</label>
</div>
</body>
答案 0 :(得分:1)
<script type="text/javascript">
$(document).ready(function() {
$("input:radio[name=radio]").click(function(){
var value = $(this).attr("id");
alert(value);
})
});
</script>
注意:强>
The button widget was added in jQuery UI 1.8, it's not part of 1.7. Make sure you have updated version.