<img src="https://u.kanobu.ru/editor/images/13/e5919cc3-4a0d-4d14-9871-ca7f21d776fc.jpg" alt="" width="300">
$('img').on('click', function(e) {
if (e.shiftKey) { //Если клик с шифтом
$(this).css('border', '4px solid red');
} else{
$(this).css('border', '4px solid green');
}
});
This Pen doesn't use any external CSS resources.