Catching up with JavaScript after years of using jQuery I found these two shortcuts for replacing longer getElementById() methods. NOTE: the querySelector is passed an ID in the CSS format
<button id="our-button">Add New Item</button> <script> // These are both the same var ourButton = document.getElementById("our-button"); var ourButton = document.querySelector("#our-button"); </script>
<ul id="our-list> <li>A thing</li> <li>Another thing</li> <li>A new thing</li> </ul> <script> // These are both the same var listItems = document.getElementById('#our-list').getElementsByTagName("li"); var listItems = document.querySelectorAll("#our-list li"); </script>