Last active
March 22, 2023 08:59
-
-
Save hudsonpereira/6b6604d1f56d3c07af347abb40b1505b to your computer and use it in GitHub Desktop.
Ideia to start refactoring jQuery based websites
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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