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 () { $(".myCls").after('<h3>This is h3 tag - Adding after div tag whose CSS class is myCls.</h3>'); $("span").after('<p style="color:red">This is a paragraph - Adding after span tag using after().</p>'); $("section").after('<h4>Adding Multiple Tags after section tag using after()</h4>', '<p style="color:green">Tag 1 : This is paragraph</p>', '<div style="color:gray">Tag 2 : This is div</div>'); }); </script> </head> <body> <h1>jQuery Manipulation Methods: after()</h1> <div class="myCls"> This is Div. </div> <span> This is span. </span> <section> This is section. </section> </body> </html>
Result: