title: Add data attribute to all images under a class
body: <p>I'm using a lightbox that requires a specific tag inside the link. I don't really want to edit every post so I'm trying to do this automatically using jquery.</p>
  
  <p>HTML</p>
  
  <pre><code>&lt;div class="wrapper"&gt;
     &lt;a href="imagelink.png"&gt;Image&lt;/a&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>JS</p>
  
  <pre><code>  $(document).ready(function() {
  
  // Scan classes
  $('.wrapper a').each(function(){
  
      // Apply tag
      $(this).parent().attr('data-lity');
  
  });
  });
  </code></pre>
  
  <p>Result should be</p>
  
  <pre><code>&lt;div class="wrapper"&gt;
     &lt;a href="imagelink.png" data-lity&gt;Image&lt;/a&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>JSfiddle <a href="http://jsfiddle.net/c2RvG/31/" rel="noreferrer">http://jsfiddle.net/c2RvG/31/</a></p>