Reputation: 383
I want get this li
, where i find mega-current-menu-item
parent ul
class. Please help me.
jQuery(document).ready(function() {
{
if (jQuery("li").hasClass("mega-current-menu-item")) {
console.log(jQuery(this).parent());
}
};
});
Upvotes: 1
Views: 25
Reputation: 1238
Ok try this, it must work definitely. I have tested in my localhost.
$(document).ready(function(){
if ($("li").hasClass("mega-current-menu-item")) {
var li = $("li.mega-current-menu-item")
console.log(li.parent().attr('class'));
}
});
Upvotes: 1