Skip to main content | Turn off styling Default page style

Question & Answer index

Hide/Show Div page content (div, p, input, etc.)

"How do I make items on my page appear or disappear?

See also: changing the class and changing the style.display

Here is an example I wrote for someone working on a "Previous Employer" section of their job application form. They wanted the form to allow for "up to 3" previous employers but did not want all 3 of them to display unless the user requested to "Add Another Previous Employer"

This sample is "dumbed down" (no validation, etc. I put it here as a demonstration of how to dynamically Show content on a page.

First Previous Employer:
Name:
Address:
Second Previous Employer:
Name:
Address:
Third Previous Employer:
Name:
Address:

Here's how it works: