Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

inline javascript alert on enter keypress using inline coding

i am trying to alert 1 on enter keypress can anyone help me to solve this? i am doing this inline because to work in rows and on every time enter key press send a row num with that request

      <input type="text" id="tt" name="tt" onkeydown="javascript: if (keyCode == 13) alert(1)"/>
like image 253
Umer Farooq Avatar asked Dec 07 '22 09:12

Umer Farooq


1 Answers

If you want to use inline js, just put event.keycode instead of keycode you can use:

<input type="text" id="tt" name="tt" onkeydown="javascript: if(event.keyCode == 13) alert(1);"/>
like image 176
technocloud Avatar answered Jan 26 '23 01:01

technocloud