I ask for help: I ​​need to highlight it when I click on the image (put a selection on it). What interests you is not the assignment of a class with some kind of color frame or transparency, but the physical setting selection. The code below only works for IE or Chrome. How to unify it including for FireFox?

var img = event.target; var range = document.createRange(); range.setStartBefore(img); range.setEndAfter(img); s = window.getSelection(); s.removeAllRanges(); s.addRange(range); 

    0