Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width">
  <title>JS Bin</title>
</head>
<body>
   <input type="file" name="img" multiple>
<script src="https://code.jquery.com/jquery-3.1.0.js"></script>
<div class="imageContainer">
    <img src="http://i.imgur.com/nN8NqpI.gif" />
    <img src="http://i.imgur.com/vj8HEPl.jpg" />
</div>
</body>
</html>
 
$(function () {
var imageUrls = [];
$(".imageContainer img").on("click", function () {
    var $img = $(this);
    var url = $img.attr("src");
    var index = imageUrls.indexOf(url);
  
    if (index === -1) {
        imageUrls.push(url);
        $img.addClass("selected");
    } else {
        imageUrls.splice(index, 1);
        $img.removeClass("selected");
    }
  
  console.dir(JSON.stringify(imageUrls));
})
});
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
Legends77pro
0viewers