title: jquery array how to get a key that has an empty value
body: <p>i have an array with some keys and values pair.</p>
  
  <p>i'm checking if there is a key that has empty value and if so I would like to know how to get this key :</p>
  
  <pre><code>$(form).on('submit',function() {
      var arr          = {};
      var elemRequired = $(this).find('input:not(input[type=button], input[type=submit], input[type=reset]),textarea,select,checkbox').filter(':visible');
      $('.error').empty();
      elemRequired.each(function(i, el) {
          arr[el.id] = el.value;
      });
      $.each(arr, function(id, val) {
          if (val == ""){
      /*here i want to get the id that has the empty value*/      
              id.addClass('invalid');
  
          }else{
  
          }
      });
  
      return false;
  });
  </code></pre>
  
  <p>i know ther might be other way to do this but i want to know if there's a way to do it like that</p>
  
  <p>thanks for the help</p>