Invoking the location.replace() Method : location « Javascript Objects « JavaScript DHTML
- JavaScript DHTML
- Javascript Objects
- location
Invoking the location.replace() Method
<html>
<head>
<title>location.replace() Method</title>
<script type="text/javascript">
function doReplace() {
location.replace("http://www.java2s.com");
}
</script>
</head>
<body>
<form name="myForm">
<input type="button" value="Replace Me" onclick="doReplace()" />
</form>
</body>
</html>
Related examples in the same category