Finds the title attribute of the first in the page. : attr « jQuery « JavaScript DHTML
- JavaScript DHTML
- jQuery
- attr
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