NextIndexPrevious

Programs in JavaScript

19. Redirection using location object.

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<script type="text/javascript">
	function redirect1()
	{
		location.href="http://www.google.com";
	}
</script>
</head>

<body>
<input type="button" value="Google" onclick="redirect1()" />
</body>
</html>

Output :





Father of JavaScript


Brendan Eich

Brendan Eich

Born: 1961, Pennsylvania