Skip to content

Instantly share code, notes, and snippets.

@hudsonpereira
Last active March 22, 2023 08:59
Show Gist options
  • Save hudsonpereira/6b6604d1f56d3c07af347abb40b1505b to your computer and use it in GitHub Desktop.
Save hudsonpereira/6b6604d1f56d3c07af347abb40b1505b to your computer and use it in GitHub Desktop.
Ideia to start refactoring jQuery based websites
function $(selector) {
this.element = document.querySelector(selector);
this.val = () => {
return this.element.value;
};
this.click = (handler) => {
return this.element.addEventListener("click", (event) =>
handler(event.target.value)
);
};
return this;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment