loss
loss
KPCKevin Powell - Community
Created by loss on 7/5/2024 in #front-end
eventListener on click
thx for the help still, is always good to learn
68 replies
KPCKevin Powell - Community
Created by loss on 7/5/2024 in #front-end
eventListener on click
without the () ofc
68 replies
KPCKevin Powell - Community
Created by loss on 7/5/2024 in #front-end
eventListener on click
and it worked
68 replies
KPCKevin Powell - Community
Created by loss on 7/5/2024 in #front-end
eventListener on click
oh yeah, i put bcs wasn't working when only passing without the () but i just had to move the const above
68 replies
KPCKevin Powell - Community
Created by loss on 7/5/2024 in #front-end
eventListener on click
this helped a lot
68 replies
KPCKevin Powell - Community
Created by loss on 7/5/2024 in #front-end
eventListener on click
thanks guys
68 replies
KPCKevin Powell - Community
Created by loss on 7/5/2024 in #front-end
eventListener on click
i got it now
68 replies
KPCKevin Powell - Community
Created by loss on 7/5/2024 in #front-end
eventListener on click
oh okay
68 replies
KPCKevin Powell - Community
Created by loss on 7/5/2024 in #front-end
eventListener on click
ok got it
68 replies
KPCKevin Powell - Community
Created by loss on 7/5/2024 in #front-end
eventListener on click
so basically js is just weird
68 replies
KPCKevin Powell - Community
Created by loss on 7/5/2024 in #front-end
eventListener on click
this just makes my mind a little lost xD
68 replies
KPCKevin Powell - Community
Created by loss on 7/5/2024 in #front-end
eventListener on click
idk
68 replies
KPCKevin Powell - Community
Created by loss on 7/5/2024 in #front-end
eventListener on click
yeah like why wasn't working when i put the checkIsEmpty after declaring the eventListener?
68 replies
KPCKevin Powell - Community
Created by loss on 7/5/2024 in #front-end
eventListener on click
weird
68 replies
KPCKevin Powell - Community
Created by loss on 7/5/2024 in #front-end
eventListener on click
i literally just had to put the function before the eventListener
68 replies
KPCKevin Powell - Community
Created by loss on 7/5/2024 in #front-end
eventListener on click
that's what made me got confused
68 replies
KPCKevin Powell - Community
Created by loss on 7/5/2024 in #front-end
eventListener on click
yeah prob is a issue with the platform i'm using on the browser than
68 replies
KPCKevin Powell - Community
Created by loss on 7/5/2024 in #front-end
eventListener on click
This way wasn't working:
checkButton.addEventListener("click", checkIsEmpty)
const checkIsEmpty = () => {
if(input.value == ''){
alert ("Please input a value");
}
}
checkButton.addEventListener("click", checkIsEmpty)
const checkIsEmpty = () => {
if(input.value == ''){
alert ("Please input a value");
}
}
Like this works:
const checkIsEmpty = () => {
if(input.value == ''){
alert ("Please input a value");
}
}

checkButton.addEventListener("click", checkIsEmpty)
const checkIsEmpty = () => {
if(input.value == ''){
alert ("Please input a value");
}
}

checkButton.addEventListener("click", checkIsEmpty)
68 replies
KPCKevin Powell - Community
Created by loss on 7/5/2024 in #front-end
eventListener on click
like before i used in the eventlistener idk why tho, it worked before the other way around
68 replies
KPCKevin Powell - Community
Created by loss on 7/5/2024 in #front-end
eventListener on click
oh wait, i just had to actually put my function before
68 replies