Development of Shift text



  • Specify how the JS can trace the text through Shift and arrow (without mice).

    I have a website where there is an element in the text. It's working with a mouse. mouseup and click♪ How to track the event when the text is available with Shift + arrow?



  • You can track the combinations of keyboards that the user presses. Writing jQuery

    $(document).keyup(function(e) {
        if (e.shiftKey && e.keyCode === 37) {
            console.log('Нажаты Shift и ←');
        }
        if (e.shiftKey && e.keyCode === 39) {
            console.log('Нажаты Shift и →');
        }
    });
    <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>


Log in to reply
 

Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2