jQuery selectors select from the document. How do I select from somewhere else other than root? Say I want to select some children from an html object.
For this
function dothis(obj)
{
$j("#tabs").removeClass();
$j("#tabs>ul").removeClass();
$j("#tabs>ul>li>a").each(function()
{
var tabNum = $j(this).attr("href").replace("#", "");
var tabContent = $j("div[id=" + tabNum + "]");
tabContent.removeClass();
$(tabContent).before("<br><h1>" +$j(this).text() + "</h1>\n" );
});
$j("#tabs>ul").each(function()
{
$j(this).empty();//remove Ul links on top
});
}
I want to reference the selectors from an html Object (obj) i passed into as argument, instead of selecting from document.
Sorry I'm pretty new to jQuery.
THIS WORKS! $j("#tabs", obj).removeClass();
THANKSFOR THE HELP! just realised i asked a silly question :P