title: I have two same html input text id but different div how to get the two id values in jquery
body: <p>I have create two div [ Div1 and Div2] have   two same html input text id. how to get the two different div with text type id values in jquery.</p>
  
  <p>when i click div 2 button it show out put first div text id values. please help this. thanks.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>function GetDiv1Value() {
      alert($('#TestId').val());
  }
  
  function GetDiv2Value() {
      alert($('#TestId').val());
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js"&gt;&lt;/script&gt;
  &lt;div id="DIv1"&gt;
          Div1:   
          &lt;input type="text" id="TestId" /&gt;
           &lt;input type="button" onclick="GetDiv1Value();"value="Div 1" /&gt;
    &lt;/div&gt;
  
    &lt;div id="Div2"&gt;
          Div2:   
          &lt;input type="text" id="TestId" /&gt;
           &lt;input type="button" onclick="GetDiv2Value();" value="Div 2" /&gt;
    &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>