Advertisement
Guest User

Untitled

a guest
Apr 10th, 2020
215
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 0.51 KB | None | 0 0
  1. <script>
  2.    
  3.     var textDiv = document.getElementByID("openclosetext");
  4.     if(textDiv)
  5.     {
  6.         var date = new Date();
  7.         var day = date.getDay();
  8.         var hour = date.getHours();
  9.  
  10.         if(day > 3 && (hour >= 12 && hour <= 17))
  11.         {
  12.           textDiv.innerHTML = "We are open for bizness";
  13.         }
  14.         else
  15.         {
  16.             textDiv.innerHTML = "Soz but we closed hun";
  17.         }
  18.     }
  19.     else
  20.     {
  21.         console.log("Div with id - openclosetext - could not be found");
  22.     }
  23.        
  24. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement