JavaScript » Special » void

The void operator evaluates an expression without returning a value. Although the use of brackets after it is optional, it is good style to use them.

Examples

Code:
Sam turned <a href="javascript:void(document.bgColor='lightgreen')">green</a>.
Explanation:

The following example creates a hyperlink on the word "green" which, when clicked, changes the background color to light green.