stuart-d2
12/12/2014 - 10:58 AM

.attr

.attr

//Set up a var targetting the selector, then grabbing the html title attribute
var title = $( "em" ).attr( "title" );

//Grabbing the div selector and outputing the title var with the text() method   
$( "div" ).text( title );
<p>Once there was a <em title="huge, gigantic">large</em> dinosaur...</p>

The title of the emphasis is:<div></div>
 
em {
    color: blue;
    font-weight: bold;
  }
  div {
    color: red;
  }