【发布时间】:2013-04-16 03:46:33
【问题描述】:
我正在尝试绑定边框图像以在您选择单选框时显示。代码如下:
<table width="100%">
<tr>
<td><img src="img/option/collar.png" width="100px" id="option_img"><br><input class="optionVent" type="radio" name="vent" value="1">vent</td>
<td></td>
<td><img src="img/option/collar.png" width="100px" id="option_img"><br><input class="optionVent" type="radio" name="vent" value="1">vent</td>
</tr></table>
这里是javascript:
$(".optionVent").click(function(){
if($(this).is(':checked')){
$("#option_img").css('border', "solid 1px orange");
}
});
As it stands now, when 1 box is selected, both images get borders.我想不出一种将图像绑定到单选框的方法。
谢谢,
【问题讨论】:
标签: jquery image input border radio