Guest User

Untitled

a guest
Apr 10th, 2020
154
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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>
RAW Paste Data