I've got a code like this, written just for the problem with the if statement:
$("ul.pick").click(function(){
var kid = $(this).find("li.contactIn");
kid.addClass("current");
var parent = kid.parent();
if(parent == $(this))
{
parent.addClass("something");
}
});
So ul.pick is a menu button, li.contactIn is its child storing the content to be shown. The problem is within the if statement. What have I done wrong? I'm trying to write the code, which will check if currently pulled down li. is the one I'm clicking at the moment. If it is, the code should just pull it up. If not, li. should be pulled down. Thanks in advance :)