1. Home
  2. Computing & Technology
  3. JavaScript

Void

By Stephen Chapman, About.com

Definition: The void method can be used to stop a value being returned from a function, method, or other code. It is normally used in bookmarklets to prevent the value returned from the bookmarklet processing from overwriting the web page. Void is a reserved word and cannot be used for anything other than to stop a value being returned.
Examples:
javascript:void(document.color='#cccccc')
Explore JavaScript
About.com Special Features

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

Easy ways to connect two computers for networking purposes. More >

  1. Home
  2. Computing & Technology
  3. JavaScript

©2009 About.com, a part of The New York Times Company.

All rights reserved.