Home >Web Front-end >JS Tutorial >js compatible carriage return and mouse focus event codes for multiple browsers (IE6/7/8, firefox, chrome)_javascript skills

js compatible carriage return and mouse focus event codes for multiple browsers (IE6/7/8, firefox, chrome)_javascript skills

WBOY
WBOYOriginal
2016-05-16 18:29:33906browse

Text box:

Copy code The code is as follows:

js code:
Copy code The code is as follows:

function keydownsearch(evt)
{
evt = (evt) ? evt : ((window.event) ? window.event : "")
keyCode = evt.keyCode ? evt.keyCode : (evt.which ? evt.which : evt.charCode);
if (keyCode == 13) {
search();//Search event
}
}
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn