Some objects in javascript can be appended a method to it.
For example we can have Array.prototype.pop = function() {...}
So what I wanna ask is that can we append a method to DOM elements?
Suppose I have the following
var x = document.getElementById("hello");
x.toggle();
How can I append a method called toggle
to DOM elements just like what we do in jquery??
Thank you so much.