Finds the title attribute of the first in the page. : attr « jQuery « JavaScript DHTML






Finds the title attribute of the first 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>

   
    
  








Related examples in the same category

1.Disable input control
2.Get attribute from tag
3.Get input control type
4.Set Image URL title alt
5.attr(key, fn)
6.Sets src attribute from title attribute on the image.
7.attr(key, value) set a single property to a value, on all matched elements.
8.attr(name): access a property on the first matched element.
9.Disable all form input controls
10.Add attribute and clear attribute
11.Set attribute with the returned function value