Location assign() Method
Location Object
Definition and Usage
The assign() method loads a new document.
Syntax
Browser Support

The assign() method is supported in all major browsers.
Example
Example
Load a new document:
<html>
<head>
<script>
function newDoc()
{
window.location.assign("http://www.w3schools.com")
}
</script>
</head>
<body>
<input type="button" value="Load new document"
onclick="newDoc()">
</body>
</html>
Try it yourself »
Location Object
Thank You For Helping Us!
Your message has been sent to W3Schools.
Close [X]