<!DOCTYPE html>
<html>
<head>
<title>jQuery attr() function</title>
<script src="jquery-latest.min.js"></script>
<script>
$(document).ready(function() {
var title = $("p").attr("style");
$("#div1").text(title);
});
</script>
</head>
<body>
<div>
<p style="background-color:#FF9933; font-family: Arial, sans-serif; text-align: center;">First paragraph start here...</p>
<div id="div1">Attribute values come from above paragraph</div>
</div>
</body>
</html>