Ask Your Question
0

Can an event handler be written in JavaScript other than by including it in the tag or using addEvent()?

asked 2023-06-09 05:18:06 +0000

woof gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2023-06-09 05:27:02 +0000

ladyg gravatar image

Yes, event handlers can be written in JavaScript using the DOM Level 2 Event Model methods like addEventListener() and removeEventListener(). These methods allow event handlers to be added and removed dynamically, rather than being hard-coded into the markup.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2023-06-09 05:18:06 +0000

Seen: 7 times

Last updated: Jun 09 '23