SCRIPT438:对象不支持属性或方法'buttonset'

时间:2014-07-03 06:36:02

标签: javascript jquery html

我尝试设置/更改标准单选按钮到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>

1 个答案:

答案 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.