title: Selecting Dynamic ID JQuery
body: <p>I need to select dynamic id using JQuery, and once I select it then I need to do some action on it. This is the HTML that I have:</p>
  
  <pre><code>&lt;input id="content_photos_attributes_1355755712119_image"   name="content[photos_attributes][1355755712119][image]" size="30" type="file"&gt;
  </code></pre>
  
  <p>Please note the id value, text is always the same however the number changes (I do not have control over that change).</p>
  
  <p>What I need to do is to create on click for that element. This is what I got so far, and it is not working.</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  jQuery.noConflict();
  
    jQuery("input[id *= 'content_photos_attributes_']").click(function() {
  
    alert("Image deletion is clicked");
  });
  &lt;/script&gt;
  </code></pre>
  
  <p>It really makes no difference whether I select that element by ID or by its name.</p>