HTML / CSS / JavaScript Tutorial

JavaScript Operator: void

[this page | pdf | back links]

In JavaScript, the void operator evaluates an expression and then returns undefined. An example of its use might be e.g.:


<a href="javascript: void(document.getElementById('xxx'). innerHTML='Changed text'); ">

Click to change text in element with id = xxx



Contents | Prev | Next | JavaScript Operators

Desktop view | Switch to Mobile