Jquery get element id

helllo forums,

In jquery how do you get an element id

example:

<a href=“test.php” class=“test” id=“12” />test</a>


$('.test').click(function(){
 
//alert id here...how?

});


Thanks


$('.test').click(function(){
  alert($(this).attr('id'));
});

:slight_smile:

Wow thanx Scallio… such a noob question hahaha.