BrU32

JQuery contents wrap freeze overflow

Jul 6th, 2016
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
  5. <script>
  6. $(document).ready(function(){
  7. $("button").click(function(){
  8. var promptt=prompt("Enter Ammount Please:");
  9. for(var i=0;i<promptt;i++){
  10. $("*").contents().filter("*").wrap("<h1/>");
  11. }
  12. });
  13. });
  14. </script>
  15. </head>
  16. <body>
  17.  
  18. <p>LOL</p>
  19.  
  20. <button>Find all text nodes in div and wrap them</button><br>
  21.  
  22. </body>
  23. </html>
Add Comment
Please, Sign In to add comment