HTML
<p href="products.php?ref=fijo&tipo=7001ad" class="principal">Fijas</p>
<div class="menu_body" id="fijo">
<a href="products.php?ref=fijo&tipo=7001ad">Normal (7001AD)</a>
<a href="products.php?ref=fijo&tipo=7001md">Aislada (7001MD)</a>
<a href="products.php?ref=fijo&tipo=7001ad80">A+ (7001AD80)</a>
<a href="products.php?ref=fijo&tipo=7001md80">A+++ (7001MD80)</a>
</div>
JQ
if(cookie = null)
{
$("div.menu_body a").click(function(){
$.cookie("current",(this).parent().attr("id"));
});
}
I can’t get the ID of the element that I’m pointing to. I don’t know if the mistake is with the parent()parent() part or anything else.
Im doing a tab system and I want to check if a tab is opened now, if there is no any cookie, if this tab is opened, and somebody clicks a link in that tab, then store the ID of the .menu_body DIV wich contains that link.
i would say you forgot a char
should look like this
you need to create a jquery object from the “this” object