Home
<!DOCTYPE html> <html> <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script> <script> $(document).ready(function () { $('<b>This is a bold tag - added using insertAfter()</b>').insertAfter('span'); $('<p style="color: red">This is a paragraph - added using insertAfter()</p>').insertAfter(".myCls"); }); </script> </head> <body> <h1>jQuery Manipulation Methods: insertAfter()</h1> <span>This is span tag</span> <div class="myCls" style="border:1px solid red;"> <p>This is paragraph</p> </div> </body> </html>
Result: