I have a HTML file and a JS file. I wrote JS in object oriented way. I want to call a method inside JS class from HTML button onclick event. Please help me with this.
Asked
Active
Viewed 20 times
-4
-
[EventTarget.addEventListener()](https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener) – Lain Jun 01 '22 at 08:18
-
Please visit the [help], take the [tour] to see what and [ask]. Do some research - [search SO for answers](https://www.google.com/search?q=javascript+call+class+from+html+site%3Astackoverflow.com). If you get stuck, post a [mcve] of your attempt, noting input and expected output using the [\[<>\]](https://meta.stackoverflow.com/questions/358992/ive-been-told-to-create-a-runnable-example-with-stack-snippets-how-do-i-do) snippet editor. – mplungjan Jun 01 '22 at 08:18