前言: jquery選擇器是大家都熟悉且常用的工具了,那么如果你使用$("table")獲取了一組table串列,那么能從串列中找到含有屬性:id="1"的table物件呢?
方法一:使用filter方法,filter只從最外層級別物件篩選物件:
$("table").filter("table[id='1']")
方法二: 使用find方法,find只查找當前元素下的所有子級元素:
//借助table的共同父級再去找子元素,下面示例是table具有相同的父級:
$("table").eq(0).parent().find("table[id='1']")
轉載請註明出處,本文鏈接:https://www.uj5u.com/qiye/205598.html
標籤:其他
