/ Published in: HTML
smaller script for selecting a time
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<html> <head> <script type="text/javascript"> var timetext=['5:00AM','5:15 AM','5:30 AM','5:45 AM','6:00AM','6:15 AM','6:30 AM','6:45 AM','7:00AM','7:15 AM','7:30 AM','7:45 AM','8:00AM','8:15 AM','8:30 AM','8:45 AM','9:00AM','9:15 AM','9:30 AM','9:45 AM','10:00AM','10:15 AM','10:30 AM','10:45 AM','11:00AM','11:15 AM','11:30 AM','11:45 AM','12:00PM','12:15 PM','12:30 PM','12:45 PM','1:00PM','1:15 PM','1:30 PM','1:45 PM','2:00PM','2:15 PM','2:30 PM','2:45 PM','3:00PM','3:15 PM','3:30 PM','3:45 PM','4:00PM','4:15 PM','4:30 PM','4:45 PM','5:00PM','5:15 PM','5:30 PM','5:45 PM','6:00PM','6:15 PM','6:30 PM','6:45 PM','7:00PM','7:15 PM','7:30 PM','7:45 PM','8:00PM','8:15 PM','8:30 PM','8:45 PM','9:00PM','9:15 PM','9:30 PM','9:45 PM','10:00PM','10:15 PM','10:30 PM','10:45 PM','11:00PM','11:15 PM','11:30 PM','11:45 PM']; function populatedropdown(timefield){ var timefield=document.getElementById(timefield) for (var m=0; m<76; m++) timefield.options[m]=new Option(timetext[m], timetext[m]) } </script> </head> <body> <select id="timedropdown"> </select> <script type="text/javascript"> //populatedropdown(id_of_time_select) window.onload=function(){ populatedropdown("timedropdown") } </script> </body> </html>