[英]Selecting children without a certain index (Jquery)
我想選擇一些沒有特定索引的孩子,例如反向使用eq()。
我還需要能夠將索引號作為變量傳遞。
$("#foo").children().not(":eq(2)");
這將選擇foo所有子項,但第三個除外( eq()使用Javascript基於0的索引)。
foo
eq()
例子
要將變量傳遞給它:
var num = "2"; $("#foo").children().not(":eq(" + num + ")").css("background-color", "red");
例
[英]Selecting elements with a certain background colour without jQuery
[英]Selecting specific children on jQuery
[英]Efficiently finding all children before a certain index in jQuery
[英]javascript addEventListener without selecting children
[英]jquery selecting children not nested in a child
[英]JQuery, selecting children of visible div
[英]Selecting Children without ID or Class names
[英]Selecting elements without jQuery
[英]separating index of children javascript jquery
[英]Selecting a parent and then children in a form using jQuery
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.