I have a problem with undefined property I added the first part of my js I have a document.readystate witch suppose to help with the Dom not reading fills but I still get undefined
if (document.readyState == `loading`) {
document.addEventListener(`DOMContentLoaded`, ready);
} else {
ready
}
function ready() {
var hiddentwo = document.getElementById(`sectiontop`)
var hidden = document.getElementById(`sectionone`)
var hiddentwo = document.getElementById(`sectiontop`)
console.log(hiddentwo)
const openModal = function() {
hidden.classList.remove(`hidesection`);
};
const closeModal = function() {
hidden.classList.add('hidden');
};
const closeModal1 = function() {
hiddentwo.classlist.remove(`hidesection1`)
};
const closeModal11 = function() {
hiddentwo.classlist.add(`hidesection1`)
};
window.onload = function() {
hiddentwo.classlist.remove('hidesection1')
};
};
.hidesection1 {
display: none;
}
<section id="sectiontop" class="hidesection1">