title: Get required fields and check if true or false
body: <p>I need to change an application which sets inputs to <code>required="true"</code> or <code>required="false"</code>. My problem here is when I try to get all of inputs which are required, I just get all of them even the <code>false</code> one.  </p>
  
  <p>What I tried: </p>
  
  <p><code>$('input[required=true')</code> -> gets all of them    </p>
  
  <pre><code>var $input = $('input');
  $.each($input, function(sKey, sValue){
      if($('#' + sValue.id).prop('required') == "true"){
          //Gets all even the false one
      }
  
      if($('#' + sValue.id).prop('required')){
          //Gets all even the false one
      }
  
      if($('#' + sValue.id).attr('required') == "true"){
          //Gets all even the false one
      }
  
      if($('#' + sValue.id).attr('required') == "required"){
          //Gets all even the false one
      }
  
      if($('#' + sValue.id).attr('required') == "required"){
          //Gets all even the false one
      }
  
  });  
  </code></pre>
  
  <p>What am I doing wrong?</p>