<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 transitional//en"> <HTML> <HEAD> <TITLE>JS's form text box in the electronic clock 丨 Shijiazhuang glass partition Manufacturers</TITLE> </HEAD> <Bodybgcolor= "#ffffff"OnLoad= "Startclock ();"> <Scriptlanguage= "JavaScript"> <!-- varTimerid= NULL vartimerrunning= false functionStopclock () {if(timerrunning) cleartimeout (timerid) timerrunning= false } functionStartclock () {Stopclock () Showtime ()}functionShowtime () {var Now= NewDate ()varhours=now.gethours ()varminutes=now.getminutes ()varseconds=now.getseconds ()varTimeValue= "" +((Hours> A) ?hours- A: Hours) timevalue+=((Minutes< Ten) ? ": 0" : ":") +minutes TimeValue+=((Seconds< Ten) ? ": 0" : ":") +secondsif(Hours>=6 &&hours<= A) {TimeValue+= ("Morning")} if(Hours> A &&hours<= -) {TimeValue+= ("Afternoon")} if(Hours> - &&hours<= -) {TimeValue+=("Night")} if(Hours<6) {TimeValue+= ("Late Night")} Document.clock.face.value=timevalue Timerid=SetTimeout ("Showtime ()", +) timerrunning= true } // - </Script> <formMethod= "POST"name= "Clock"> <P><inputtype= "text"name= "Face"size= "One"style= "Font-size:9pt"></P> </form> </BODY> </HTML> <BR><BR><HR>
The electronic clock in the JS form text box