void operator evaluates an expression and returns undefined. - Javascript Operator

Javascript examples for Operator:void

Description

void operator evaluates an expression and returns undefined.

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>


<p>
<a href="javascript:void(0);">
  Useless link//from  w  w  w .  ja  v a 2  s.  c  o m
</a>
</p>

<p>
<a href="javascript:void(document.body.style.backgroundColor='red');">
  Click me to change the background color of body to red.
</a>
</p>

</body>
</html>

Related Tutorials