title: Why doesn't jquery get input value?
body: <p>I have used an asp.net repeater to repeat images.</p>
  
  <p>I want to get the primary key ID returned from the database upon clicking the image via jquery but it shows undefined. I am storing image in input text field and it's getting displayed in that but not in alert.</p>
  
  <p>jQuery:</p>
  
  <pre><code>function displayStory() {
      var txtIDValue = $(this).find('input[id$=txtID]').val();
      var id = txtIDValue;
      alert(id);
  }
  </code></pre>
  
  <p>Repeater:</p>
  
  <pre><code>&lt;asp:Repeater ID="rptrImages" runat="server"&gt;
      &lt;ItemTemplate&gt;    
          &lt;div class="col-md-4"&gt;
              &lt;div class="thumbnail"&gt;
                  &lt;input type="text" id="txtID" value='&lt;%#Eval("ID")%&gt;' /&gt;
                  &lt;asp:ImageButton ID="imgButtonStory" OnClientClick='displayStory();return false;' runat="server" ImageUrl='&lt;%# "UploadedImages/"+ Eval("Image") %&gt;' 
                   CssClass="img-responsive img-rounded" /&gt;
              &lt;/div&gt;    
          &lt;/div&gt;
      &lt;/ItemTemplate&gt;
  &lt;/asp:Repeater&gt;
  </code></pre>