2012-03-31 100 views
0

我有一个radiogroup,我从中选择任何一个。同时,当我点击组中的任何单选按钮时,我正在对父组应用边框。所以当我点击组中的其他单选按钮时,它应该应用点击的边框,并且需要从所有其他兄弟家长中删除边框......有什么好方法可以做到这一点?jquery radiogroup删除选定的边框aparat

这是我的代码,但不工作:

$('input:radio[name="cci"]').click(function(){ 
    $(this).parent().css({border:'1px solid red'});//in the group, rest of the parent need to remove the border..how? 
    }) 

意义,而这是在选定的位置只有父母需要有边界

回答

1

加入这一行

$('input:radio[name="cci"]').click(function(){ 
    $('input:radio[name="cci"]').css({border:'none'}); 
    $(this).parent().css({border:'1px solid red'});//in the group, rest of the parent need to remove the border..how? 
    }) 
+1

作品。我在第一行添加了父项。感谢 – 3gwebtrain 2012-03-31 12:53:17

+0

是否有可能为单一功能的所有群体做? – 3gwebtrain 2012-03-31 12:53:55