JavaScript Programming JavaScript > Code Examples Wrap p with div tag Wrap p with div tag <html> <head> <script type='text/javascript' src='js/jquery-1.3.2.js'></script> <script type='text/javascript'> $(document).ready( function() { $('p').wrap('<div></div>'); } ); </script> <style type='text/css'> h4, p { margin: 5px; } div { background: #fedd58; border: 1px solid #ebcb49; margin: 3px; } </style> </head> <body> <p> happycodings.com </p> </body> </html>