這個jQuery腳本適用於firefox,它會給出警報。 但它在IE 7中不起作用。有什麼想法出了什麼問題?jQuery兄弟姐妹()/ next()在IE中不起作用
標記:
<td class="tdnotes">
<a title="" class="notes" id="order-1" href="#">
<!-- an image -->
</a>
<div style="display: none;" id="wrap-order-1" class="thenotes">
<!-- text area, input elements -->
</div>
</td>
腳本:
$(function(){
$("a.notes").click(function() {
alert($(this).siblings().attr("class"));
// I have tried .next() but didn't work as well
// alert($(this).next().attr("class"));
return false;
});
});
你是在ready()還是load() ? – cletus 2009-10-26 10:28:45