title: Javascript Count number of time same value repeated in the textbox(s)
body: <p>The below code add as yes if the master class text box value matches with the user but i want to compare the master with the user class and print the number count result in a div of how many input user class have the same repeated value of as master has.</p>
  
  <p>Html:</p>
  
  <pre><code>&lt;input class="master" value="1"&gt;
  &lt;input class="user" value="1"&gt;
  &lt;input class="user" value="1"&gt;
  &lt;input class="user" value="0"&gt;
  &lt;input class="user" value="0"&gt;
                      &lt;div id="result_count"&gt;&lt;/div&gt;
  </code></pre>
  
  <p>Javascript:</p>
  
  <pre><code>$(function() {
    var master = $('input.master').get(0).value; // get the master value
    var fn = function() {
      return this.value === master ? "yes" : "no";//if current text-box matches master,then yes else no
    };
    $('input.user').val(fn); // loop and replace text for each user input
  });
  </code></pre>