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 () { $("div").prepend('<span>This is span - added before div tag using prepend().</span>'); $("p").prepend('<b>Important</b>', '<i>Message:</i>'); }); </script> </head> <body> <h1>jQuery Manipulation Methods: prepend()</h1> <div style="border:1px solid red;">This is div tag</div> <p>This is paragraph.</p> </body> </html>
Result: