document.tags.backgroundColor

JavaScript 1.2+ Nav4+ Syntax

document.tags.tagName.backgroundColor

Description

The backgroundColor property specifies the background color associated with the tag called tagName.

Example

Listing 7.163 uses the backgroundColor property to make the background color around an anchor red.

Listing 7.163 Setting the Background Color with the backgroundColor Property
<html>

<script>
<!-- Hide

//Create a style sheet id that contains the background color
document.tags.A.backgroundColor = "red";

//Hide End --->
</script>

<a name="THIS">This</a> is an anchor that uses
styles from the A tag.

</html>
							
							
							
						

Get Pure JavaScript now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.