title: Does this code need these return? and his variable would not change?
body: <p>this code it checks to see if the input boxes are empty, but does this return with or without it work? and this variable with true after its value is changed it continues with same value for next execution, its value should not be maintained until I send a new value?</p>
  
  <p>CODE:</p>
  
  <pre><code>&lt;input value="g" type="text" placeholder="a" class="test"&gt;
  &lt;input value="" type="text" placeholder="a" class="test"&gt;
  
  &lt;button onclick="win()"&gt;okkk&lt;/button&gt;
  
  
  var inputs = document.getElementsByClassName('test');
  var len = inputs.length;
  var valid = true;
  
  for(var i=0; i &lt; len; i++) {
      if (!inputs[i].value) {
          valid = false;
      }
  }
  
  if (valid) {
      console.log("ok");
      return true;
  } else {
      console.log("no");
      return false;
  }
  </code></pre>