window.home()

JavaScript1.2+, Jscript3.0 Nav4+, IE4+ Syntax

							window.home()

Description

The home() method of the Window object simulates the user clicking the Home button on the browser. It takes the browser to the user's specified home page.

Example

Listing 7.545 has a single button that, when clicked, takes the browser to the user's home page.

Listing 7.545 Using the home() Method to Go to the User's Home Page
<html>
<body>
<form>
<h3>Home James!</h3>
  <input type=BUTTON value="Home" onClick="window.home()">
</form>
</body>
</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.