So quick example
//example
var el = document.getElementById("test");
el.classList.add("my-class");
//my function
var myFunction = function(){//code goes here};
el.myFunction();
//and can we take it further by adding a method to it like classList does
el.myFunction().myMethod();
I know I'm probably not using the right lingo here, because a method is a function of a class which means myFunction()
must be a class. I'm just confused on if something like this is possible. Anyways...
How can i create a function that can be chained to an element like that?
Thanks for your help