Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

how to add shortcuts in javascript

document.addEventListener('keydown', (e) => {
    e.preventDefault();

    if (e.key.toLowerCase() === 's' && e.ctrlKey) {
        // Add your code here
        alert('S key pressed with ctrl');
    }
});
Source by www.webmound.com #
 
PREVIOUS NEXT
Tagged: #add #shortcuts #javascript
ADD COMMENT
Topic
Name
3+8 =