我想动态地添加一个功能,在IE7以外的所有浏览器上工作正常的标签。点击事件不工作在jQuery IE7中
<head>
<script type="text/javascript" src="jquery-1.8.3.js"></script>
<script type="text/javascript">
function show(num){
if(num==1){
$('#one').removeAttr('onclick')
$('#two').attr('onclick','show(1)')
alert(0)
}}
</script>
</head>
<body>
<a href="javascript:void(0)" onclick="show(1)" id="one">one</a>
<a href="javascript:void(0)" id="two">two</a>
</body>
</html>
请添加相关小提琴\ – aBhijit
小提琴也不会在IE 7 :) –
工作@DadoJerry它甚至不会在8我的机器上工作。 9或更高。 Chrome ftw。 – War10ck