Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <script src="http://code.jquery.com/jquery-latest.js"></script>
- <script>!window.jQuery && document.write(unescape('%3Cscript src="js/jquery-1.7.2.min.js"%3E%3C/script%3E'))</script>
- </head>
- <body>
- <div>happy New year</div>
- <script>var elements = $('div');
- // go through the elements and find the one with the value
- elements.each(function(index, domElement)) {
- var $element = $(domElement);
- // does the element have the text we're looking for?
- if ($element.text() === "happy New year") {
- $element.hide();
- // hide the element with jQuery
- return false;
- // jump out of the each
- }
- }
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement