The clock appears at any given location

Source: Internet
Author: User
Tags current time
Display Script Description:

: Add the following code to the area:
<span Id=liveclock style=position:absolute;left:250px;top:122px;; width:109px; Height:15px>
</span> (You can adjust the position of the clock here.) Remove the contents of parentheses when calling a script
<script language=javascript>
<!--
function show5 () {if (!document.layers&&!document.all)
Return
var digital=new Date ()
var hours=digital.gethours ()
var minutes=digital.getminutes ()
var seconds=digital.getseconds ()
var dn= "AM"
if (hours>12) {dn= "PM"
Hours=hours-12
}if (hours==0)
Hours=12
if (minutes<=9)
minutes= "0" +minutes
if (seconds<=9)
seconds= "0" +seconds
Change font Size your desire
myclock= "<font size= ' 5 ' face= ' Arial ' ><b><font size= ' 1 ' >current time:</font></br>" + hours+ ":" +minutes+ ":"
+seconds+ "" +dn+ "</b></font>"
if (document.layers) {document.layers.liveclock.document.write (Myclock)
Document.layers.liveclock.document.close ()
}else if (document.all)
Liveclock.innerhtml=myclock
SetTimeout ("show5 ()", 1000)
}
>
</SCRIPT>



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.