how to catch multiple ids?
<p>My button is dynamic. So, It has multiple ids say view-123, view-324, view-423 etc. On button click I am calling a <code>jQuery</code> file having:</p>

<pre><code> $(document).ready(function() {
        $('tr[id^view-]').click(function() {
            alert(this.id)
        });
    });
</code></pre>

<p>To catch the <code>id</code>, But it is not working?</p>

<pre><code> $('.view').click(function() {
        alert(this.id)
   });
</code></pre>

<p>This is returning nothing.
html is:</p>

<pre><code>{% for item in users %}

          &lt;tr class="row"&gt;
            &lt;td class="number"&gt;{% if item.phone_number %}{{ item.phone_number }}{% else %}-{% endif %}&lt;/td&gt;

            &lt;td&gt;&lt;input type="submit" class="view" name="view-{{ item.phone_number }}" value="View"&gt;&lt;/td&gt;

          &lt;/tr&gt;
{% endfor %}
</code></pre>
