Last active
September 29, 2020 15:56
-
-
Save dualyticalchemy/f80afe33b7de05c05f222494d4736678 to your computer and use it in GitHub Desktop.
abolish jquery, obviously, etc.
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
const $$ = (el) => document.querySelector(el); | |
const $ = (el) => ({ | |
ready: (cb) => el.addEventListener('DOMContentLoaded', cb), | |
click: (cb) => $$(el).addEventListener('click', cb), | |
hide: () => $$(el).setAttribute('style', 'display: none;') | |
}); | |
$(document).ready(() => { | |
$('button').click(() => { | |
$('p').hide(); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment