Uncaught TypeError: Cannot read properties of null (reading 'addEventListener') in javaScript [duplicate]

Place the <script> tag after the <div class="icons">

Scripts cannot get DOM content loaded after it

Or you could wrap your javascript in:

window.addEventListener('DOMContentLoaded', () => {
   // Your code here
})

To wait for the DOM content all loaded in before the script :)