I want restrict jQuery to specific namespace or DOM node. Currently what I do is something lik this on every line
$('a' , $node).addClass();
$('li' , $node).removeAttr();
$('div#q' , $node).hide();
And so on.. Is there any shortcut/method which I can specify after which the scope of jQuery object will be limited to $node.
You can alter the $ method directly.
Assign $ to a function returning $node.find() and you’re done.
jsfiddle: http://jsfiddle.net/pmYRw/1/