Pastebin launched a little side project called HostCabi.net, check it out ;-)Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Dec 9th, 2012  |  syntax: None  |  size: 0.69 KB  |  hits: 29  |  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. <html>
  2. <head>
  3.             <script src="http://code.jquery.com/jquery-latest.js"></script>
  4.     <script>!window.jQuery && document.write(unescape('%3Cscript src="js/jquery-1.7.2.min.js"%3E%3C/script%3E'))</script>
  5. </head>
  6. <body>
  7. <div>happy New year</div>
  8. <script>var elements = $('div');
  9.  
  10. // go through the elements and find the one with the value
  11. elements.each(function(index, domElement)) {
  12.     var $element = $(domElement);
  13.  
  14.     // does the element have the text we're looking for?
  15.     if ($element.text() === "happy New year") {
  16.         $element.hide();
  17.             // hide the element with jQuery
  18.         return false;
  19.             // jump out of the each
  20.     }
  21.    }
  22. </script>
  23. </body>
  24. </html>