You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
hello AbodyHisham, the problem is in the syntax, since you are writing the ".querySelector" command wrong since it is missing the word "all" at the end, the correct form would be the following: "modalBtns = document.querySelectorAll('.services__button '),".
Idk why it gives me this error please help ! the error shown below is (
javascript.js:16
Uncaught TypeError: Cannot read properties of null (reading 'forEach')
at javascript.js:16:11 )
const modalViews = document.querySelector('services__modal');
const modalBtns = document.querySelector('services__button');
const modalClose = document.querySelector('services__modal-close');
let modal = function(modalClick){
modalViews[modalClick].classList.add('active-modal')
}
modalBtns.forEach((mb,i) => {
mb.addEventListener('click' , () => {
modal(i)
})
});
The text was updated successfully, but these errors were encountered: