javascript - Jquery and Get traversing API -



javascript - Jquery and Get traversing API -

is there simple way node list (including given node) matched query jquery?

i thought using .find method following:

var getnodes = function(dom, query){ var nodes = $(dom).find(query || '*'); nodes.splice(0,0,dom); homecoming nodes; }

olivier

if want search within set made of dom , contents elements matching query, can do

$(dom).find(query).add($(dom).filter(query))

or

$(dom).find(query).addback().filter(query);

a simpler 1 (but slower if there many children) be

$(dom).find('*').addback().filter(query);

javascript jquery splice

Comments

Popular posts from this blog

javascript - mongodb won't find my schema method in nested container -

How do you set up a perforce server to work over the internet? -

ios - Lagging ScrollView with UIWebview inside -