JSFiddle - React, Tailwind, and code Playground

by BramVanroy

HTML

<img src="http://placehold.it/200x150">
<img src="http://placehold.it/50x150">
<img src="http://placehold.it/75x75">
<img src="http://placehold.it/80x120">
<img src="http://placehold.it/40x90">

CSS

a img {border: 2px solid red;}

JavaScript

var img = $("img"),
    a = "<a href='",
    b = "' rel='lightbox[",
    galName = "chooseName",
    c = "]'>";

img.each(function() {
    var $this = $(this);
    if ($this.width() > 100 || $this.height() > 100) {
        $this.wrap(a + $this.attr("src") + b + galName + c);
    }
});