Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Jan 19th, 2012  |  syntax: None  |  size: 0.49 KB  |  views: 183  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. <!doctype html>
  2. <html lang="en">
  3. <head>
  4.   <style type="text/css">
  5. .box {
  6.         background-color:#FFFF00;
  7. }
  8. </style>
  9.  
  10. <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
  11.  
  12. </head>
  13. <body>
  14.   <script>
  15. [].forEach.call( document.querySelectorAll('.box'), function(el) {
  16.   el.style.color = 'red'; // or add a class
  17. });
  18.   </script>
  19.  
  20. <div class="box">
  21.         This is red
  22.         </div>
  23.        
  24. <script>
  25.         $(‘.box’).css(‘color’, ‘red’);
  26. </script>
  27.        
  28. </body>
  29. </html>
clone this paste RAW Paste Data