When I alert
$(this).attr("clicked") == "aa"
it alerts true. But this code does not alert aa.
if ($(this).attr("clicked") == "aa"){
alert("aa");
}
Can anyone help with this issue?
Thanks
EDIT
Content of this is
<a id='Comedy' hoverb='green' clicked='aa'>want to laugh</a>
Whole piece of the code:
$('.left a').live("click", function() {
if ($(this).attr("clicked") == "aa"){
$(this).css('background',black);
alert("aa");
}
else {
//do somethingelse
}
});
clicked is not a default attribue .. Try this instead..
Also this does not make any sense without a context .. If you do not specify the context this means the window..
// try this
UPDATED CODE
Check DEMO
UPDATED DEMO