This method is used to insert the data after some specified tag or content . It is just same as jQuery append( ) method. If you want to insert the data before some specified tag or content then you should use before ( ) method. Syntax :
$(selector).after(content,function(index))
Example :
HTML Code :
<html>
<head></head>
<body>
<button>After click ,Data added after p tag</button>
<p>Hello Mukesh Tomar</p>
<p>From Meerut</p>
</body>
</html>
jQuery Code :
$(funtion(){
$("button").click(function(){
$("p").after("<p><b>I have added after p tag</b></p>");
});
});
0 Comment(s)