为什么我的Jquery使用this不对呢?
.............
<script type="text/javascript">
function provinceSelected(){
alert($(this).attr("id"));
}
</script>
........
<input type="checkbox" id="04" onclick="provinceSelected();" name="mbgTopProvince" value="04" />
<label for="04">重庆 </label>
--------------
为什么alert有响应,但是取不到id值呢? 我试了好多种办法,都不行,直接 alert($("#04").attr("id")); 这样就可以取到 “04”,说明不是我jquery文件引入的路径不对。 为什么我使用 this 不行? 请针对 使用this的解决用法来回答。我要的主要的不是实现,而是使用 this 的正确方法????