Grep value : Grep « jQuery « JavaScript DHTML






Grep value

    

<html>
  <head>
    <script type="text/javascript" src="js/jquery-1.3.2.js"></script>
    <script type="text/javascript">
        $(document).ready(function(){
              var arr = [ 1, 3, 5,  7 ,5 ,6 ,7,9];

              arr = jQuery.grep(arr, function( i){
                  return (i > 4);
              });
              alert(arr.join(", "));
            

              

        });
    </script>
  </head>
  <body>
    <body>
        <p></p>
    </body>
</html>

   
    
    
    
  








Related examples in the same category

1.Grep callback
2.Grep with index
3.Grep and regular expression