Skip to content

Tag: if-statement

variable (element).style is undefined

why it says variable (element).style is undefined? I tried .style.color=”red”; on a different code & it works! Answer First you have to compare against counter.innerHTML because you update its value.The value of counter doesn’t change and will all the time be 10 as you can see in the sni…

Ties are still running win messages?

I’ve been messing around with a rock, paper scissors project that codecademy gets you to try, I’m pretty happy with it but I have one problem! When the result is a tie, it logs the tie message (perfect!) but also logs the win message linked with the result! How do I get it to ONLY log the tie mess…

syntax error unexpected toke in if statement in js

I am receiving a syntax error with unexpected token < at line 14 when i try to run this script in my browser. What i am trying to do is open my classes 5 minutes before class and still open when ran all the way up to 5 minutes before the next class. Answer date.getTime() doesn’t return the time of