[Html] <input type = "button" onclick = "startTime () "value =" Timing "/> <br/> <div id =" txt "> </div> <br/> [javascript] view plaincopyprint? Var d = new Date () var weekday = new Array (7) weekday [0] = "Sunday" weekday [1] = "Monday" weekday [2] = "Tuesday" weekday [3] = "weekday" weekday [4] = "Thursday" weekday [5] = "Friday" weekday [6] = "Saturday" document. write (d. getFullYear () document. write ("today is" + weekday [d. getDay ()]) [javascript] function startTime () {var today = new Date () var h = today. getHours () var m = today. getMinutes () var s = today. getSeconds () // add a zero in front of numbers <10 m = checkTime (m) s = checkTime (s) document. getElementById ('txt '). innerHTML = '<div>' + h + ":" + m + ":" + s + "</div>" t = setTimeout ('starttime ()', 500)} function checkTime (I) {if (I <10) {I = "0" + I} return I} [javascript] var arr = new Array (3) arr [0] = "George" arr [1] = "John" arr [2] = "Thomas" var arr2 = new Array (3) arr2 [0] = "James" arr2 [1] = "Adrew" arr2 [2] = "Martin" document. write (arr. concat (arr2) [javascript] var arr = new Array (3 ); arr [0] = "George" arr [1] = "John" arr [2] = "Thomas" document. write (arr. join (); document. write ("<br/>"); document. write (arr. join (". "); [javascript] var arr = new Array (6) arr [0] = "George" arr [1] = "John" arr [2] = "Thomas" arr [3] = "James" arr [4] = "Adrew" arr [5] = "Martin" document. write (arr + "<br/>") document. write (arr. sort () [javascript] function sortNumber (a, B) {return a-B} var arr = new Array (6) arr [0] = "10" arr [1] = "5" arr [2] = "40" arr [3] = "25" arr [4] = "1000" arr [5] = "1" document. write (arr + "<br/>") document. write (arr. sort (sortNumber ))