title: How do I make a javascript variable from this span element while using fancybox?
body: <p>I could use some help isolating an element or two and putting them into javascript variables. I am still learning how to properly identify things in the DOM, I have to imagine what I am trying to do is possible.</p>
  
  <p>Consider the following:</p>
  
  <pre><code>$('.fancybox').fancybox({
      'autoScale': false,
      'type': 'iframe',
      'padding': 0,
      'closeClick': false,
      helpers: {
          overlay: {
              closeClick: false
          }
      },
      afterShow: function () {
          $("#overlay_content_top").show();
          $("#overlay_content_bottom").show();
      },
      afterClose: function () {
          $("#overlay_content_top").hide();
          $("#overlay_content_bottom").hide();
      }
  });
  
  &lt;div class ="example"&gt;
  &lt;a class="fancybox" href="http://my-iframe.example"&gt;&lt;img src="myimage.jpg" width="x" height="y" /&gt;&lt;/a&gt;
  **&lt;span&gt;Important Information I need&lt;/span&gt;**
  &lt;/div&gt;
  </code></pre>
  
  <p>I need to put the html from <em>.example span</em> into a variable and then apply it to something that is displaying in the fancybox.  </p>
  
  <p>So something like this in crazy pseudo code:</p>
  
  <pre><code>var getname = $(this).html('.example span');
  
  $('.inherit_span').html(getname);
  </code></pre>
  
  <p>I have twenty different items on the page that can be clicked and I dont want to have to generate separate id's or names for each item, I would rather just grab the html from the span when the fancybox function is called and then apply that name to another element within the lightbox display. Any help appreciated.</p>