SHARE
TWEET

Untitled

a guest Jun 16th, 2013 57 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <!DOCTYPE html>
  2.  
  3. <html xmlns="http://www.w3.org/1999/xhtml">
  4. <head runat="server">
  5.     <title></title>
  6.     <script src="scripts/jQuery.js"></script>
  7.     <style>
  8.         div{
  9.  border: 10px solid blue;
  10.         }
  11.     </style>
  12. </head>
  13. <body>
  14.     <button id="before">Insert Before</button>
  15.     <button id="after">Insert After</button>
  16.    
  17.     <p id="element"></p>
  18. </body>
  19. <script>  
  20.     $("#before").click(function myfunction() {
  21.         $("<div></div>").insertBefore($("#element"));
  22.     })
  23.  
  24.     $("#after").click(function myfunction() {
  25.         $("<div></div>").insertAfter($("#element"));
  26.     })
  27. </script>
  28. </html>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top