-
Notifications
You must be signed in to change notification settings - Fork 185
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Another Issue in the JS modal button comand #6
Comments
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 '),". I hope I helped you bro |
I noticed it after I submitted the issue ty tho ✌️
…On Sun, Feb 27, 2022, 7:54 AM PabloA-Development ***@***.***> wrote:
hello abodyhisman, 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 '),".
I hope I helped you bro
—
Reply to this email directly, view it on GitHub
<#6 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AXZX5CYWPXDYCRHO4U2ALVDU5G37VANCNFSM5O4QAIJA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you authored the thread.Message ID:
***@***.***
com>
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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: