DEV Community


import and export in JS modules

I am learning Web Dev as quickly as possible
・1 min read

I am trying to export an html element i selected in one Javascript file and when I try to import it and console.log it, I am getting undefined or null. This is the line: export const notes = document.querySelector("#notes");

if i try to export anything else except for html elements in my js file, everything works fine.

Discussion (0)