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 () { $('#div1').after('<div style="background-color:yellow"> New div </div>'); }); </script> <style> div{ border: 1px solid; background-color:red; margin: 2px 0 2px 0; } </style> </head> <body> <h1>Demo: jQuery after() method </h1> <div id="div1">div 1 </div> <div id="div2">div 2 </div> </body> </html>
Result: