BrU32

JQ Fill And Color All Empty DOM Elements

Jul 18th, 2016
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. <center>
  2. <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
  3. <script>
  4. $(this).click(function(){
  5. $(":empty").css("background-color", "red");
  6. $(":empty").text('TEST!!');
  7. });
  8. </script>
  9. </head>
  10. <body><textarea>This JQuery source shows you how to find elements that are empty or not.</textarea>
  11. <textarea></textarea><br>
  12. <li></li>
  13. <br><br>
  14. <button>Find Empty Elements</button>
  15. </body>
  16. </html>
Advertisement
Add Comment
Please, Sign In to add comment