Home  >  Article  >  Web Front-end  >  Document.addEventListener usage introduction_javascript skills

Document.addEventListener usage introduction_javascript skills

WBOY
WBOYOriginal
2016-05-16 16:56:211667browse

document.addEventListener("Event name", function, false);

Copy code The code is as follows:

function a function (event){
// method execution
}

The last parameter in addEventListener determines the response order of the event;

if true The order of event execution is addEventListener ---- the onclick event of the label ---- document.onclick

If it is false, the order of events is the onclick event of the label ---- document.onclick ---- addEventListener

is understood as the call entry point for other codes
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