Mon Jan 07, 2013 8:37 pm
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
Transitional//EN" "http://www.w3
.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>print HTML attributes using JQuery</title>
<!--
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js">
</script>
Note you can download the JQuery package instead of using Google version. -->
<script src="jquery-1.8.3.js"></script>
<script>
$(document).ready(function(){
$("button").click(function(){
$("div").append($("p").attr("id")+"<br/>");
$("div").append($("p").attr("style")+"<br/>");
$("div").append($("p").attr("width")+"<br/>");
});
});
</script>
</head>
<body>
<p id="infox" style="background:#5454F4;width='100';"
width="200">MY DIV CONTENT</p><br>
<div></div>
<button>Show Attributes</button>
</body>
</html>
Codemiles.com is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com
Powered by phpBB © phpBB Group.