$(this) inside append()

$(this) inside append()

hi, i would like to append the name attribute as text for some elements on my web site to test something.

i have tried:


  1. btn_group = $( '.btn-group.alive' );

  2. alert( btn_group.attr( 'name' ) ); //this give me an alert with the right name (it work)

  3. btn_group.append('<p>' + $this.attr('name') + '</p>'); //wich doesn't work.. 
how can i do it?