Q:

Getting an attribute when I click on a button

I'd like to get the rel attribute when I do click  on a button how this: (targeting with class selector)
<button class="nameClass" rel="relName">Content</button>

For that I am trying
$(".nameClass").click(function(){
    // Here I want to get the rel content of the button that I clicked
})

Thanks in advance
Best regards

A:

$(".nameClass").click(function(){
   alert($(this).attr('rel'));
})

