title: Set data-attribute if contains image as child
body: <p>To get my lightbox working, I am trying to set the data attribute "lightbox" on links that contain an image as a child. This doesn't seem to work too well. I have this <a href="http://jsfiddle.net/m8cew/" rel="nofollow">fiddle</a>.</p>
  
  <pre><code>var links = $(".single .entry-content a");
  links.each(function () {
      if ($(this).children("img").length &gt; 0) {
          $(this).data("lightbox","image-gallery");
          console.log("test");
      }
  });
  </code></pre>
  
  <p>The console logs, but the data-attribute isn't set. What did I do wrong?</p>