Layer element

Layers were the core of a method of dynamic HTML programming specific to Netscape 4. Each layer was treated as a separate document object in JavaScript. The content could be included in the same file within the non-standard  element (or any other element with the positioning set to "absolute" via CSS) or loaded from a separate file with   or. It could also be generated via JavaScript with the  constructor. The content would then be inserted into the layer with.

Because it was only recognized in Netscape 4, a common shortcut among JavaScript coders at the time to specialize certain events only for Netscape or only for Internet Explorer was to identify if the browser accepted layers. Thus, the coder would code something like this:

(code that would be executed only by Netscape browsers) (code that would be executed by Internet Explorer)

In modern browsers, this functionality is provided by using an absolutely-positioned div, or, for loading the content from an external file, an IFrame.