To work with a simple java script
Step 1
To work with a simple java script, the first thing you need to do is to use the mouse to create the Create Script button.
JavaScript sample
document.write("Your Local Time"),
currtime = new Date();
document.write("It is currently " + currtime + " where you live.")
The document.write() method writes an H1-formatted text string from the document to the screen of the browser.
The new Date()creates a new date object containing the long version of the current date from the vieweræ¯ operating system. This object is assigned to currtime.
The last line is output again to the browseræ¯ screen using a document.write() method, with the embedded currtime variable set to the current time and date.
Step 2
The result will appear as below.
No comments:
Post a Comment