JQuery JavaScript Tutorial

< html>
  
    
    
        $(document).ready(function(){
      var testData = [];
      var pattern = /^\d{5}(-\d{4})?$/;
      var originalArray = ['11111','abcde','1asdfasdf','asdfasdf-0339'];
      var badZips = $.grep(
                      originalArray,
                      function(value) {
                         return value.match(/^\d{5}(-\d{4})?$/) != null;
                       },
                       true);
      alert(badZips);
        });
    
  
  
    
        Follow me!