October 18, 2015 • ☕️ 1 min read
One of my favorite things about this was instead of having to use the
onclick() event handler to traverse a certain part of the DOM (when something is clicked) you could listen for any type of click events with
addEventListener() to listen for a click on an element specified as the argument to the method. For instance here:
addButton.onclick = addTask; //Set the click handler to the addTask function addButton.addEventListener(&quot;click&quot;, addTask); addButton.addEventListener(&quot;click&quot;, ajaxRequest);
This is much faster and easier than traversing each element with the
Nick and I connected on LinkedIn and, impressed with my social media and blogging output, reached out to me to collaborate on the blog and my podcast which you can find here. I found a place for him to write here and he will be a co-host on my weekly show which hasn’t been weekly in a minute. My fault totally. But that changes with Nick on board.
Thanks Nick and I hope you get something out of it. I hope my readers enjoy his posts as well. You can find Nick on Twitter.