Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Thank you, Dan Levy
- function domReady(f, o, m) {
- (o = document), (m = 'addEventListener');
- o[m] ? o[m]('DOMContentLoaded', f) : ((o = window), o.attachEvent('onload', f));
- }
- // example usage:
- domReady(function() {
- const form = document.querySelector('form');
- document.querySelector('form').addEventListener('change', getAdjective);
- });
Add Comment
Please, Sign In to add comment