Ask Your Question
1

Why does javascript not react to modifications in the HTML code?

asked 2023-07-09 14:36:22 +0000

woof gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2023-07-09 14:52:01 +0000

djk gravatar image

Javascript is executed or interpreted by the browser after the HTML code is loaded and rendered on the page. Therefore, if the HTML code is modified dynamically, the changes will not affect the currently executed Javascript code. To make Javascript react to modifications in the HTML code, the code needs to be executed again after the modifications are made. This can be done by adding event listeners or using Javascript frameworks that handle changes in the HTML code automatically.

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-07-09 14:36:22 +0000

Seen: 11 times

Last updated: Jul 09 '23