Wednesday, 6 November 2013

Appending Content In The Div

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Untitled Document</title>
<style>
#msg{
 width:260px;
 height:60px;
 background-color:#CCC;
 padding:20px;
}
h3{
 width:300px;
 border:1px solid #CCC;
 text-align:center;
 cursor: pointer;
 cursor: hand;
 margin-bottom:20px;
}
</style>
<script src="jquery-1.10.2.min.js"></script>
<script>
$(document).ready(function() {
    $("h3").click(function(){
  $("#msg").append("<p>'Write less: Do more'</p>");  
 });
});
</script>
</head>

<body>
<h3>Click to append Content</h3>
<div id="msg">jQuery is a fast, small and feature-rich <b>JavaScript</b> library.</div>
</body>
</html>

0 comments:

Post a Comment