我设置了如下单选按钮,

    <input type="radio" NAME="pizzasize" value="1"/>100&#37; of the time<br />
   <input type="radio" NAME="pizzasize" value="2" />75&#37; of the time<br />
       <input type="radio"  NAME="pizzasize" value="3"/>50&#37; of the time<br />
       <input type="radio"  NAME="pizzasize" value="4"/>25&#37; of the time<br />




我需要更改单选按钮的格式,如上图所示。
我怎样才能做到这一点?..

谢谢
拉维

最佳答案

最简单的方法可能是为“ selected”定义一个类,然后将该类分配给单选按钮列表的选中选项。

$("#whatevertheparentidis :radio").removeClass("selected");
$("#whatevertheparentidis :checked").addClass("selected");


您可以将图像定义为.selected类上的背景图像。

07-24 09:47
查看更多