Mega Code Archive

 
Categories / JavaScript Tutorial / JQuery
 

Finds the title attribute of the first em in the page

< html>   <head>     <script type="text/javascript" src="js/jquery-1.3.2.js"></script>     <script type="text/javascript">         $(document).ready(function(){             var title = $("em").attr("title");             $("div").text(title);                });     </script>   </head>   <body>     <body>              <em title="title value">       <div></div>     </body> </html>