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