JavaScript/DHTML

DHTML - an abbreviation for Dynamic HTML - is a term denoting the combination of HTML, JavaScript, and CSS. It does not introduce or define any new technology.

This page offers some examples of integrating HTML, JavaScript, and CSS.

messages
This will give a simple alert message.

This will give a simple prompt message.

This will give a simple confirmation message.

Button and alert
Sometimes it is best to dig straight in with the coding. Here is an example of a small piece of code:

What does this code do? When it loads, it tells what value the variable  should have. The following code snippet is a function that has been named "bomb". The body of this function fires some alert messages and changes the value of.

The next part is mainly HTML, with a bit of JavaScript attached to the INPUT tags. The "onclick" property tells its parent what has to be done when clicked. The  function is assigned to the first button; the second button just shows an alert message with the value of.

Two scripts
Now, back to the first example. We have modified the script, adding a different welcome message. This version requests the user to enter a name. They are also asked if they want to visit the site. Some CSS has also been added to the button.