JavaScript Scripts





Español Français 中文 Deutsch Portuguese Japanese nederlands
   
 
Free Java Script Codes
Javascript List All
Slide Show Slide Show
Ad Display Ad Display
Image Effect Image Effect
Animated Image Effects Animated Image Effects
Form Validation Form Validation
Color Picker Tool Color Picker Tool
Formatting Forms Formatting Forms
Select All Select All
Dynamic Form Select Dynamic Form select
Dynamic Color Dynamic Color
Calendar Script Calendar
Textbox Counter Textbox Counter
Alphanumeric Alphanumeric
Date Time Script Date & Time
Stop Watch Script Stop Watch script
Delete Repeated Values Delete Repeated Values
Pagination Pagination
Random Generator Random Generator
Animated Text Animated Text
Cursor Position Cursor Position
User Info Window / User Info
Security Security / Authenticate
Bookmark Bookmark
Mouse Effects Mouse Effects
Title Bar Title Bar
Status Bar Status Bar
Country List Country List
Free Games Free Games
Calculators Calculators
 




Alarm Clock Script


About
This free online alarm clock or wakeup watch javascript is used for setting time in order to wakeup or to remind some important event that will occur at a specific time.


Features
a)It shows the current time and you can set the time using select box which is in the format of HH:MM:SS.
b)It will alert you, when it reaches the time set by you.
c)Works only in Internet Explorer(IE), firefox requires add-ons.
d)This is also used as wakeup alarm clock.
e)Just copy the code and use it

Preview


Alarm-Clock
   :     :  
Alarm is OFF




Code
Javascript code
<!-- Script by hscripts.com -->
<style type="text/css">
.time { border-width: 0px; }
</style>
<script type="text/javascript">
var set=0;
ver=parseInt(navigator.appVersion);
ie4=(ver>3  && navigator.appName!="Netscape")?1:0;
function play() 
{
 if (ie4) 
     document.all['BGSOUND_ID'].src='sound1.wav';
}
function setv()
{
 var hr2    = document.getElementById('hour2').value;
 var min2   = document.getElementById('min2').value;
 var sec2   = document.getElementById('sec2').value;
 if(hr2<10)
  hr2='0'+hr2;
 if(min2<10)
  min2='0'+min2;
 if(sec2<10)
  sec2='0'+sec2;
 document.getElementById('d2').value=hr2+'*'+min2+'*'+sec2;
 set=1;
 document.getElementById('msg').innerHTML='Alarm is ON';
}
function dis()
{
 var dat= new Date();

 var hr=dat.getHours();
 var min=dat.getMinutes();
 var sec=dat.getSeconds();
 if(hr<10)
  hr='0'+hr;
 if(min<10)
  min='0'+min;
 if(sec<10)
  sec='0'+sec;
 document.getElementById('hour').value=hr;
 document.getElementById('min').value=min;
 document.getElementById('sec').value=sec; 
 var dat2v=document.getElementById('d2').value;
 var dats =hr+'*'+min+'*'+sec;
 if(dat2v==dats && set)
 {
   play();
   alert("Wake Up Man!");  
   set=0;
   document.getElementById('msg').innerHTML='Alarm is OFF';
 }
 setTimeout("dis()",500);
}
function prtsel(x)
{
   for(var i=0;i<x;i++)
     document.write("<option value="+i+">"+i+"</option>");
}
</script>

<!-- Script by hscripts.com -->


HTML Code
<table align=center width=45%>
<tr><td>
 <body onload=dis()>
 <BGSOUND id="BGSOUND_ID" LOOP=1 SRC="silence.wav">
 <input type=hidden id=d2 name=d2>
 <input type=text id=hour name=hour size=1 class=time> :
 <input type=text id=min name=min size=1 class=time> :
 <input type=text id=sec name=sec size=1 class=time>
 <br/>
 <select id=hour2 name=hour2 onChange="setv()">
 <script type='text/javascript'>prtsel(25);</script>
 </select>
 <select id=min2 name=min2 onChange="setv()">
 <script type='text/javascript'>prtsel(61);</script>
 </select>
 <select id=sec2 name=sec2 onChange="setv()">
 <script type='text/javascript'>prtsel(61);</script>
 </select>
 <div id=msg>Alarm is OFF</div>
 </body>
</td></tr></table>


Get free version without ©copyright link for just 5 price

For customization of this script or any script development, contact us at support@hscripts.com


Usage
a) Copy the above code into your file and use the clock.
b) Here, <body onload=dis()> is used to perform "dis()" function while the page is loaded.
c) When you set time using select box, "dis()" function is called to alert you when it reaches the time set in clock.



License
- The javascript (misspelled as java script) is given under GPL License
- i.e. Free use for those who use the codes as it is.
- Free, if your modification does not remove our copyright information and links.
- Click Here for detailed license information.
- You can purchase the script if your requirements does not meet our GPL License terms.
Other Links

web hosting