Gets the element in the active tab, satisfying the specified conditions
jQueryGetElement = function(aSelector, aIndex);
//Select the first element div with id = sidebar var element = jQueryGetElement('div#sidebar',0); //If the element is found, the if (element.varName !== ''){ //Emulate a click on it ClickElement(element); }
//Select a random span element that is in a div element var element = jQueryGetElement('div span',-1);
//Select the second img element that is after a span element var element = jQueryGetElement('span + img',1);