1

Can someone tell me why this doesn't work in IE7 please and how to to best refactor it to work in IE7 as well as the other major browser such as Chrome, Firefox and Safari?

    var validTabSet = $('[tabindex]:not([tabindex=-1]):not([type=hidden]):not([disabled=true])');

Thanks

David

4

1 に答える 1

1

渡すセレクターを複数のセレクターに因数分解:notできます

var validTabSet = $("[tabindex]:not([tabindex=-1], [type=hidden], [disabled=true])");

それでも IE7 で失敗する場合は、セレクターの代わりにnot()メソッドを使用できます。

var validTabSet = $("[tabindex]").not("[tabindex=-1], [type=hidden], [disabled=true]");
于 2012-10-16T11:52:23.330 に答える