Controlling page navigation using javascript

In this example, we control the navigation dynamically using javascript

<script language="javascript" type="text/javascript">

function navigate()


<body >
<input id="btn" name="btn" type="button" value="click here" onclick="'meta.html');" />

<input id="btn1" name="btn1" type="button" value="Go to Page1" onclick="window.location.href='page1.html';" />
<br />
<a href="page1.html">Page1.html</a>
<br />
<a href="javascript:;" onclick="window.location.href='page1.html';">Page1.html</a>
<br />
<a href="javascript:;" onclick="navigate();">Page1.html</a>


The above example also shows how we can display a popup window using javascript. To display the popup, the simplest method call is"pagename");

Add a Comment

Your email address will not be published. Required fields are marked *