Category "addeventlistener"

Why is my page not loading when clicking on event listener?

I'm creating an anime quiz. So when the user clicks on "Welcome to the anime quiz" s/he should be presented with 4 different anime titles. However, nothing happ

e.preventDefault() not working in 100% cases

I'm trying to disable every click events on a web pages. document.addEventListener("click", function (e) { e.preventDefault(); e.stopImmediatePropag

To merge window resizing and loading the page events into one function

I have a local html page that serves me a cheat sheet about how width, max-width and min-width work. It dynamically reports you the width of the body and of the

How to return value from addEventListener

I use Javascript to catch the x and y position for when user clicks a link. I can make it work, but I want it to return the two values to function init() when i

Google Maps API v3 binding events to multiple maps

I've got a page with two Google maps on, using the v3 API. Currently they have one pin each, with the same lat & long set for each pin, although one of the

Code inside DOMContentLoaded event not working

I have used <!DOCTYPE html> <html> <head> <meta charset="utf-8" /> </head> <body> <button type="button" id="button"&

HTML5 Video - Pause when get to middle of video

Aim: video clip is in 2 parts: first half of content is the playing forwards, the second half is the first half in reverse. The video plays when mouseover and w

How to attach a keyup event to Custom Element shadowRoot

I have searched for some time; but only find Polymer answers; or answers where EventListeners are put on DOM elements inside the shadowRoot. The effect I am try

JavaScript, for each hover over change the text color

I have 4 div (colored box) and each div represent a different color. When a user hovers over one of the colored boxes the text to display ("Hello world") should

How to add event Listeners in Angular?

I am writing an app using Angular 6, trying yo listen to plotly_click events (Visualization library). How can i set up a listener? The Angular is recommendin