title: Check if input text is filled and display different divs
body: <p>I have 3 input text and I want to display a div if one over 3 is filled, a different div if 2 input over 3 are filled and so on. How can I do it with javascript?</p>
  
  <pre><code>&lt;input type="text" id="text1" name="text1" /&gt;
  &lt;input type="text" id="text2" name="text2" /&gt;
  &lt;input type="text" id="text3" name="text3" /&gt;
  </code></pre>
  
  <p>I tried this but it doesn't work</p>
  
  <pre><code>function display() {
      if ($('#text').val() != '') {
          document.getElementById('green').style.display = 'block';
      }   
  }
  </code></pre>