Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

if event keycode and click

function advance(event) {
  if (event instanceof MouseEvent) {
    console.log('clicked');
  } else if (event instanceof KeyboardEvent && event.keyCode === 13) {
    console.log('enter');
  }
}

window.addEventListener('keypress', advance);
Comment

PREVIOUS NEXT
Code Example
Javascript :: global catch in javascript 
Javascript :: response intersepters for axios create 
Javascript :: mui link icon 
Javascript :: rewrite expressjs url 
Javascript :: how to change the text of a paragraph 
Javascript :: react switch case 
Javascript :: react new project 
Javascript :: multiple forms formData js 
Javascript :: AJAX - Server Response 
Javascript :: check cookies client side 
Javascript :: ternary operator nodejs 
Javascript :: javascript problem solving interview questions 
Javascript :: currenttarget javascript 
Javascript :: js filter text 
Javascript :: How to change height of bottom material tab navigator from react-naviagtion 
Javascript :: angular formatting numbers with -commas 
Javascript :: convert positive to negative number javascript 
Javascript :: how to check request type in js 
Javascript :: how to open a tcp connection in javascript 
Javascript :: shell 
Javascript :: js array map skip element 
Javascript :: Get title assert 
Javascript :: concat no and string in javascript 
Javascript :: javascript function return 
Javascript :: js dataset 
Javascript :: how to add changes every time you route navigate to page in angular 
Javascript :: javascript get response payload 
Javascript :: how to add a tilemap in phaser 3 
Javascript :: jquery check valid link 
Javascript :: how to change data value in jquery 
ADD CONTENT
Topic
Content
Source link
Name
9+2 =