Hi.
I have to set a class name on a (li) element. This script find all the (a) elements in the list, and creates a click event.
jQuery("#" + ElementID).find(TagName).click(function () {
GetPageByUrl(jQuery(this).attr("href"));
jQuery(this).parent().addClass('yourClass');
//ChangeSelectedMenuItem(this);
return false;
});
The parent of every (a) element is a (li) element
But nothing happens when this line is executing jQuery(this).parent().addClass('yourClass');
Everything else is working just fine.
What am I doing wrong here?