prepend method in jquery

<html>
<head>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript">
$(document).ready(function(){
  $("button").click(function(){
    $("p").prepend("Mahak Garg ");
  });
});
</script>
</head>
<body>
<p> is a girl</p>
<p> loves asp.net</p>
<button>Click Me!!!</button>
</body>
</html>


Output

1.png


After we click the Button:



Mahak Garg is a girl
Mahak Garg loves asp.net


Ebook Download
View all
Learn
View all