Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Java by (13.1k points)
Can anyone help me with the difference between documnet.addEventListener and window.addEventListener? And which is better for use?

1 Answer

0 votes
by (26.7k points)

Basically, there is no difference between using a document and a window. You can use any of those as per your preference. Some functions like a scroll and resize should be available in the window.addEventListener.

I hope this will help.

Want to know more about Java? Prefer this tutorial on Learn Java.

Want to become a Java Expert? join Java Certification now!!

Related questions

0 votes
1 answer
asked Mar 1, 2021 in Java by dante07 (13.1k points)
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...