Fantasy-Map-Generator/utils/shorthands.js
2024-10-07 01:32:01 +02:00

11 lines
267 B
JavaScript

const byId = document.getElementById.bind(document);
Node.prototype.on = function (name, fn, options) {
this.addEventListener(name, fn, options);
return this;
};
Node.prototype.off = function (name, fn) {
this.removeEventListener(name, fn);
return this;
};