title: How to select multiple div id's that begin with string with jQuery
body: <p>In the snippet below, $modal is undefined because there are multiple form instances.</p>
  <pre><code>&lt;script type=&quot;text/javascript&quot;&gt;
    $(document).ready(function() {
      var $modals = $(&quot;.update-form&quot;);
      var $form = $(&quot;#program-update-form-{{ form.instance.uuid }}&quot;);
  
      $modals.on(&quot;hide.bs.modal&quot;, function() {
        $form.trigger(&quot;reset&quot;);
      });
  
    });
  &lt;/script&gt;
  
  
  &lt;html&gt;
    {% for id in form.instance.uuid %}
      &lt;div id=&quot;program-update-modal-{{ form.instance.uuid }}&quot; class=&quot;update-form&quot;&gt;
    {% endfor %}
  &lt;/html&gt;
  </code></pre>
  <p>I think what I'm wanting to do is here is gather all program-update-modals and trigger a reset on the hide.bs.modal action.  The number of form instances is going to be dynamic and obviously the uuid's will be dynamic so I need to know how in jQuery to just grab all the div id's beginning with 'program-update-modal-'.  Open to other suggestions as well.</p>