html - Setting up a JavaScript that writes whether the store is Open or Closed -
i'm trying setup basic javascript, if day sunday or saturday, write "closed" in html, or if it's later 5:30pm, or it's earlier 9:00am, write out closed.
my main problem if statement seems return true. i've tried multiple things fix , no avail. appreciated.
this not complete answer, more advanced comment on code styling.
your if statements complicated, still dont understand them. improve code make more readable. makes easier , improve it. example:
status="opened"; if(date=="wednesday"){ if(time>closetime){ status="closed. late"; } if(time<opentime){ status="closed. youre early"; } } else { //code other dates } //echo code document.write(status);
Comments
Post a Comment