Skip to main content

Hidden content, document.write, and scripts that modify content

Web checkpoint 5

On this page:



Hidden content

Often scripts write content to special sections of a page, for example, using IFRAME or DIV. The scripts are written in a manner that the content written is not visible or is hidden. Depending on user interaction, hidden content is made visible and, perhaps, other visible content is now hidden. A common example on Web sites are the so-called "fly-over menus" and "plus-to-expand" navigation areas. It is with this hidden content and associated event handlers that the issues of accessible scripting may get confusing.

When using scripts to hide content, content developers are required at a minimum to use one or more of the following techniques:

One or more of the above techniques are required; the following technique is recommended to enhance accessibility

document.write

Scripts can write content directly to the document. The most common way for scripts to do this is using document.write.

Technique summary of hidden content, document.write, and scripts that modify content
Required: Recommended:
Hidden content

document.write

Scripts that modify content

Hidden content document.write Scripts that modify content