Web Design / HTML

  1. Home
  2. Computing & Technology
  3. Web Design / HTML
Simple JavaScript for DHTML
HTML Questions That are Answered with JavaScript

 More of this Feature
• Main Page
• View source of today's date script
• View source of countdown script
• View source of lowercase script
• View source of character counting script
 
 Related Resources
• Form Validation
• Quick JavaScript
• JavaScript Links
 
 From Other Guides
• JavaScript Guide
 
 Stay Up-to-Date
  with Web Design
  Email:
  

By Jennifer Kyrnin

JavaScript is the functionality behind Dynamic HTML, and while I am not the JavaScript Guide, I often get questions about how to do things "using HTML" that can actually only be done using JavaScript. While I am not an expert on JavaScript, if you're interested in learning DHTML, you can start with these simple scripts to make your pages more dynamic. To learn JavaScript, please check out Robert's site.

Playing with Dates
There is a lot you can do with dates and JavaScript. Here are my favorites:

  • Display Today's Date
    The easy way:


    The hard way:

    View the code


  • Countdown to a day
    There are
    View the code


Validating Forms
Using JavaScript is a common way to validate forms. I've written another article on how to do most form validation, but I left a couple of things out. Here are some other validations that you can do:

  • force the characters in a text field to be all lowercase
    Type something (with capital letters):
    View the Source


  • limit the characters in a textarea field
    Try to submit more than 10 characters:
    View the Source

These scripts are fairly simple. If you are looking to do more complex things with your JavaScript, you should check the JavaScript site at About.

This article was written for Jason.

Next page > View source of today's date script > Page 1, 2, 3, 4, 5

Previous Features

Explore Web Design / HTML

About.com Special Features

Build Your Own Website

Step-by-step advice on how to do everything from choosing a Web host to promoting your content. More >

Connect Your Home Computers

Easy ways to connect two computers for networking purposes. More >

Web Design / HTML

  1. Home
  2. Computing & Technology
  3. Web Design / HTML

©2009 About.com, a part of The New York Times Company.

All rights reserved.