I have a link like this:
<a class="search_res_click" target="_blank" href="#">
<div>
// lot of stuff here
</div>
</a>
And I attached an event to all such links via following:
$(".search_res_click").click(function(e) {
$(".search_res_click").children().css("opacity", "1");
$(e).css("opacity", "0.5");
console.log($(e));
});
The function of the event handler is to change the opacity of the clicked link. But when I am clicking on the link it is not changing the opacity.
Could you please tell me what I am doing wrong here.
eis an event, not the element itself. Use$(this)