<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');
  }
});

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

  1. https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js