I have two elements with class "rate". The first element has id="1", and the second has id="2". When i use my selector :
$(".rate").click(function()
{
var id=$(this).attr('id');
alert(id);
//Do something here
}
I get answer = 1. How can i get the element with class="rate" and id = "2" ?