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
timoOP11mo ago
No description
timo
timoOP11mo ago
the goal is too change the href to 1 of the const codes when the code is correct
MarkBoots
MarkBoots11mo 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
timoOP11mo ago
No description
timo
timoOP11mo ago
tried this now but only 1313 works and not 2005 @MarkBoots
MarkBoots
MarkBoots11mo 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
timoOP11mo ago
codepen?
MarkBoots
MarkBoots11mo ago
#how-to-ask-good-questions
MarkBoots
MarkBoots11mo 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
timoOP11mo ago
why not with query? and how would i implement them cuz im kinda braindead at 1 30 at night rn :/
MarkBoots
MarkBoots11mo 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
timoOP11mo ago
i did 3 hours ago gonna finish it now bro pls help cmon
b1mind
b1mind11mo ago
Please be respectful for others time. People are helping on their own freetime here.
timo
timoOP11mo ago
im stuck for 3/4 hours at 2 midnight
vince
vince11mo ago
No one forced you to start your homework the night before it was due
timo
timoOP11mo ago
it is not about me but don t wanna fail cuz of shitt team an can pay ig
vince
vince11mo ago
Bruh lol just take the L on this and start your assignments earlier next time
timo
timoOP11mo ago
bro i failed alr cuz of my shitteam
b1mind
b1mind11mo 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
vince11mo ago
What do you need help with anyway? Can you explain it in plain english and I can help maybe
timo
timoOP11mo ago
to change the link to the correct path when the code is correct
timo
timoOP11mo ago
so like 1313 works
No description
timo
timoOP11mo ago
but need this one to work filepath is 100% right
vince
vince11mo ago
Why is it in an interval?
timo
timoOP11mo ago
interval?
vince
vince11mo ago
let intervalId = setInterval(() => {
let intervalId = setInterval(() => {
timo
timoOP11mo 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
vince11mo 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
b1mind11mo ago
I'd grab that link fast before I ban you Cause we don't need this kinda attitude around here, no ty.
vince
vince11mo ago
Lol did you ban them
b1mind
b1mind11mo ago
ya ofc sorry if your effort is wasted, I really appreciate you helping even after they were they way they were.
vince
vince11mo 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
b1mind11mo ago
I gave them the time they expected from us to get the solution
Want results from more Discord servers?
Add your server