Tag Archives: html

We all see those fields that mask (or hide) data while you type, specifically Password Fields. Each character you type is replaced with a symbol, tipycally an asterisk or a small circle (depending on the browser you’re using).

We all know what they are, why they’re useful (keeping sensitive data such as your password from prying eyes), but have you ever wondered how to create one? Well, today I’m going to provide a step-by-step guide on how to create…

How to display an alert box to users, showing additional information or a simple message.

The alert() statement generates a message box with the message you specify, and an OK button to close the box. The alert box takes the focus away from the current window, and forces the browser to read the message. The user cannot continue viewing your web pages until the box is closed.

The following JavaScript code is to be placed in the body section of your web page, positioned wherever you’d like it to appear:

Displaying the last modified date and time of a web page is important for a web page with changing content.

A small line of JavaScript code will generate the date and time that you last saved your web page. Usually this information appears at the bottom of the web page. JavaScript uses the document.write() method to generate text, and the document.lastModified property to store the date and time when you last saved your web page. The JavaScript code must be enclosed within a starting and ending script tag.

The date and time information that appears is based on Greenwich Mean Time (GMT) and it indicates when you last saved the web page on the web server.

HTML Tips & Tricks – Change background colors at the push of a button.
Here is a way to let users change the background color of your web page. You can create buttons using the input tag with the type attribute set to button. Then, assign the JavaScript code that changes the background color to the one set by the button. The color of the background is stored in the JavaScript variable document.bgColor.