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

web services - java.lang.NoClassDefFoundError: Could not initialize class net.sf.cglib.proxy.Enhancer -

Accessing MATLAB's unicode strings from C -

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