Okay so i have been looking on how to call a method from javascript in an onclick event in for example let's say a button, but i can't find any answers.
This is what I have:
Javascript
class SomeClassName() {
methodName() {
alert("test");
}
}
html
<button type="button" onclick="methodName()">Click me</button>
Obviously I didn't expect this to work since you need to make an instance like:
Object = new SomeClassName();
Object.methodName();
But I can't figure out how to do this on an onclick event.