![]() ![]() In this article, we'll assume the function name is AnEventHasOccurred (). The specified function contains the code for the desired action. ![]() Tweet this The way to trigger an action is to specify the event in relation to a JavaScript function name. setTimeout(f, 2000) ĭocument.querySelector('#btn'). The JavaScript events onkeydown, onkeyup, onclick and onchange can be used to make something happen. You can create events with the Event constructor like in the following example which uses the EventTarget. An uppercase 'A' is reported as 65 by all events. For example, a lowercase 'a' will be reported as 65 by keydown and keyup, but as 97 by keypress. ![]() The keydown and keyup events provide a code indicating which key is pressed, while keypress indicates which character was entered.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |