Wrap tag to add border : wrapInner « jQuery « JavaScript Tutorial






<html>
  <head>
    <script type="text/javascript" src="js/jquery-1.3.2.js"></script>
    <script type="text/javascript">
        $(document).ready(function(){
             $("p").wrapInner($("<span class='red'></span>"));


        });
    </script>

    <style>
      .red { border:2px green solid;}
    </style>
  </head>
  <body>
    <body>
       <p>Hello</p>

    </body>
</html>








30.119.wrapInner
30.119.1.Add border with wrapInner
30.119.2.Wrap tag to add border
30.119.3.Innerwrap created element
30.119.4.Innerwrap tags