JS code associated with button and enter key

Time:2020-11-21

Copy code

The code is as follows:

<html>
<head>
<script language=’javascript’>
function onEnterDown(){
if(window.event.keyCode == 13){
onButOk();
}
}
function onButOk(){
Button events;
}
</script>
</head>
<body onkeydown=’onEnterDown();’>
< input type = “button” accessKey = value = login “onclick =” onbutok() “/ >
</body>
</html>

Recommended Today

Explain module, import and export in JavaScript

Author: Tania rascia Crazy technology house Original text:https://www.taniarascia.com/j… In the era of the Internet, websites are mainly developed with HTML and CSS. If you load JavaScript into a page, it usually provides effects and interactions in the form of small fragments. Generally, all JavaScript code is written in a file and loaded into a filescriptTag. […]