title: Bootstrap - Modal - Access value of parent object
body: <p>I have a class of links which when clicked launch a modal window. Within the modal window how can I access the href of the object which spawned the modal? My goal is to use a button within the modal window which, when clicked will open a window to the href of the caller.</p>
  
  <p>I don't need code to display the modal window for this class of links, just how to acccess values from the parent object.</p>
  
  <p>thanks</p>
  
  <p>Example as requested:</p>
  
  <pre><code>&lt;li&gt;&lt;a href="http://foo" rel="ExtLink"&gt;blah&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href="http://bar" rel="ExtLink"&gt;Test&lt;/a&gt;&lt;/li&gt;
  </code></pre>
  
  <p>Modal:</p>
  
  <pre><code> &lt;div class="modal fade" id="ModalTest" tabindex="-1" role="dialog" aria-labelledby="ModalTestLabel" aria-hidden="true"&gt;
  
            &lt;div class="modal-dialog"&gt;
                  &lt;div class="modal-content"&gt;
                    &lt;div class="modal-header"&gt;
                          &lt;button type="button" class="close" data-dismiss="modal" aria-hidden="true"&gt;&amp;times;&lt;/button&gt;
                          &lt;h4 class="modal-title" id="ModalTestLabel"&gt;External URL warning&lt;/h4&gt;
                    &lt;/div&gt;
                    &lt;div class="modal-body"&gt;
                          External URL warning here.
                    &lt;/div&gt;
                    &lt;div class="modal-footer"&gt;
                          &lt;button type="button" class="btn btn-default" data-dismiss="modal"&gt;Exit&lt;/button&gt;
                          &lt;button type="button" class="btn btn-primary"&gt;I understand, visit link&lt;/button&gt;
                    &lt;/div&gt;
                  &lt;/div&gt;&lt;!-- /.modal-content --&gt;
            &lt;/div&gt;&lt;!-- /.modal-dialog --&gt;
          &lt;/div&gt;&lt;!-- /.modal --&gt;
  </code></pre>
  
  <p>Open from JS:</p>
  
  <pre><code>$("a[rel='ExtLink']").click(function(e){
      $('ModalTest').show();
  
  });
  </code></pre>
  
  <p>So if I click either of these a modal window opens. Within the modal window I want a button that when pressed launches the href of the caller. Thanks</p>