OneCompiler

Before_after

109
<!DOCTYPEhtml> <html> <head> <title>InserttextbeforeandafterparagraphusingjQuery</title> <scriptsrc=https://code.jquery.com/jquery-3.6.0.min.js></script> </head> <body> <h1>InserttextbeforeandafterparagraphusingjQuery</h1> <p>Thisisaparagraph.</p> <script> $(document).ready(function(){ $(“p”).before(“Textinsertedbeforetheparagraph.“); $(“p”).after(“Textinsertedaftertheparagraph.”); }); </script> </body> </html