The onload attribute can be used to check the visitor's browser type and browser version, and load the proper version of the web page based on the information. function multiply (a: number, b: number) {. You can also go to the search page to find another event. Making statements based on opinion; back them up with references or personal experience. access key and value of object using *ngFor, Angular/RxJS When should I unsubscribe from `Subscription`. But if JavaScript support is disabled or non-existent on the user's browser, then the event listener for click is ignored, and the browser loads the referenced resource in the target frame or window that has the name "WikipediaWindowName". By clicking Post Your Answer, you agree to our terms of service, privacy policy and cookie policy. It's important to note that using onclick we can add just one listener function. Let's say we gather data about how the page is used: mouse clicks, scrolls, viewed page areas, and so on. That may sound weird, but most browsers ignore event.preventDefault(). The open() method of the Window interface loads a specified resource into a new or existing browsing context (that is, a tab, a window, or an iframe) under a specified name. So you can use defer with addEventListener and it will load fastest in new browsers but still load in old ones. How do you explicitly set a new property on `window` in TypeScript? Note: For more details about the target attribute, see or