我想動態地添加一個功能,在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