我正在尝试在 Jquery 中实现一个简单的代码,如果我单击类的任何元素,我必须得到一个弹出窗口说hello。
我试过这个:
$(document).ready(function(){
$(".thumb_radio").click(function(){
alert("hello");
});
});
但这不起作用。
HTML是这样的:
<tr>
<td>
<input id="thumb_radio_0" class="thumb_radio" type="radio" value="0" name="thumbnail_template">
Please select ...
</td>
</tr>
<tr>
<td>
<input id="thumb_radio_1" class="thumb_radio" type="radio" value="1" name="thumbnail_template">
one
</td>
<td>
<input id="thumb_radio_2" class="thumb_radio" type="radio" value="2" name="thumbnail_template">
two
</td>
<td>
<input id="thumb_radio_3" class="thumb_radio" type="radio" value="3" name="thumbnail_template">
three
</td>
<td>
<input id="thumb_radio_4" class="thumb_radio" type="radio" value="4" name="thumbnail_template">
four
</td>
</tr>
我错过了什么?