Hi folks,
I am writing some js but want to use multiple css selectors - See my code:
My before code:
document.querySelectorAll('.login .login-bottom').addEventListener('click',
function () {
console.log('login btn clicked');
jQuery('.user_check, .forgot_password, .create_login_popup').fadeOut("fast");
jQuery('.login_popup').fadeIn("fast");
});
document.querySelector('.login-bottom').addEventListener('click',
function () {
console.log('login Bottom btn clicked');
jQuery('.user_check, .forgot_password, .create_login_popup').fadeOut("fast");
jQuery('.login_popup').fadeIn("fast");
});
Me trying this:
document.querySelectorAll('.login, .login-bottom').addEventListener('click',
function () {
console.log('login btn clicked');
jQuery('.user_check, .forgot_password, .create_login_popup').fadeOut("fast");
jQuery('.login_popup').fadeIn("fast");
});
Can you do this? Cheers