Пример:
Найти атрибут title первого элемента <em> на странице.
"HTML"
Once there was a <em title="huge, gigantic">large</em> dinosaur...
The title of the emphasis is:<div></div>
"CSS"
em { color:blue; font-weight;bold; }
div { color:red; }
"Живой пример jQuery"
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<link href="http://slyweb.ru/css/jqueryiframe.css"
rel="stylesheet" type="text/css"/>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.0/jquery.min.js"></script>
<script>
$(document).ready(function(){
var title = $("em").attr("title");
$("div").text(title);
});
</script>
</head>
<body class="iframe">
Once there was a <em title="huge, gigantic">large</em> dinosaur...
The title of the emphasis is:<div></div>
</body>
</html>
<style>
em { color:blue; font-weight;bold; }
div { color:red; }
</style>