need to couple class to my js file

ps im tired it is 1 at night here trying to fix it
No description
34 Replies
timo
timo6mo ago
No description
timo
timo6mo ago
the goal is too change the href to 1 of the const codes when the code is correct
MarkBoots
MarkBoots6mo ago
if(inputValue in codes) is not a valid statement to check if an object key excists. try
if(codes[inputValue]){
...
}
if(codes[inputValue]){
...
}
timo
timo6mo ago
No description
timo
timo6mo ago
tried this now but only 1313 works and not 2005 @MarkBoots
MarkBoots
MarkBoots6mo ago
hard to tell with the screenshots. in the first one you share getElementByClassName (which returns a list) not a single value, and now you do a queryselector that should be correct. what is the error you get in the console? even better, make a codepen so we can check it out ourself.
timo
timo6mo ago
codepen?
MarkBoots
MarkBoots6mo ago
#how-to-ask-good-questions
MarkBoots
MarkBoots6mo ago
ah okay, you have to be more specific with selecting the correct <a> element to change the url. give each a unique id and select that in the if-statements
timo
timo6mo ago
why not with query? and how would i implement them cuz im kinda braindead at 1 30 at night rn :/
MarkBoots
MarkBoots6mo ago
then you have to come back tomorrow. you decide to post a question in the middle of the night for me it is night too, im going to bed.
timo
timo6mo ago
i did 3 hours ago gonna finish it now bro pls help cmon
b1mind
b1mind6mo ago
Please be respectful for others time. People are helping on their own freetime here.
timo
timo6mo ago
im stuck for 3/4 hours at 2 midnight
vince
vince6mo ago
No one forced you to start your homework the night before it was due
timo
timo6mo ago
it is not about me but don t wanna fail cuz of shitt team an can pay ig
vince
vince6mo ago
Bruh lol just take the L on this and start your assignments earlier next time
timo
timo6mo ago
bro i failed alr cuz of my shitteam
b1mind
b1mind6mo ago
or do what devs do and research and find a solution on your own 🤷‍♂️ its out there or rethink your approach to find a solution. Lets not continue this path though, just remember to be patient when asking for help here. Everyone that helps is a volunteer that likes to help out of good will and nerd snipping. Vince I appreciate your candor but I had already said something lets not stir fires please.
vince
vince6mo ago
What do you need help with anyway? Can you explain it in plain english and I can help maybe
timo
timo6mo ago
to change the link to the correct path when the code is correct
timo
timo6mo ago
so like 1313 works
No description
timo
timo6mo ago
but need this one to work filepath is 100% right
vince
vince6mo ago
Why is it in an interval?
timo
timo6mo ago
interval?
vince
vince6mo ago
let intervalId = setInterval(() => {
let intervalId = setInterval(() => {
timo
timo6mo ago
dunno someone else wrote that but do you know how to fix the 2005 in it then it is done so any idea how to fix it? thx for ghosting f you all 😉
vince
vince6mo ago
I was putting it in codepen I just spent 20 min even after you were super entitled, and I could be super petty and not give it to you but here https://codepen.io/vince1444/pen/PoLKLZr You will no longer be getting help from me
b1mind
b1mind6mo ago
I'd grab that link fast before I ban you Cause we don't need this kinda attitude around here, no ty.
vince
vince6mo ago
Lol did you ban them
b1mind
b1mind6mo ago
ya ofc sorry if your effort is wasted, I really appreciate you helping even after they were they way they were.
vince
vince6mo ago
No worries, it wasn't. Whenever I talk 💩 I feel like I need to at least be some help. Plus it was a learning experience for me as I've never really done something like that before
b1mind
b1mind6mo ago
I gave them the time they expected from us to get the solution