When selecting images one by one and highlighting them with border:2px solid #b404ae;
, I want to place a tick image at the bottom of the selected images. However, my attempt was unsuccessful as only the border color is showing. Can anyone provide me with a solution for this issue?
CSS:
.highlighted {
border: 2px solid #b404ae;
background-image: url(image/tick.png);
}
Javascript:
<script type="text/javascript">
var ImageSelector = function() {
var imgs = null;
var selImg = null;
return {
addImages: function(container) {
imgs = container.getElementsByTagName("img");
for (var i = 0, len = imgs.length; i < len; i++) {
var img = imgs[i];
img.className = "normal";
img.onclick = function() {
if (selImg) {
selImg.className = "normal";
}
this.className = "highlighted";
selImg = this;
};
}
}
};
}();
</script>
<script type="text/javascript">
var div = document.getElementById("textbox");
ImageSelector.addImages(div);
</script>