Skip to content

Instantly share code, notes, and snippets.

@dualyticalchemy
Last active September 29, 2020 15:56
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dualyticalchemy/f80afe33b7de05c05f222494d4736678 to your computer and use it in GitHub Desktop.
Save dualyticalchemy/f80afe33b7de05c05f222494d4736678 to your computer and use it in GitHub Desktop.
abolish jquery, obviously, etc.
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