Welcome to W3Courses
 Like Us on Facebook

Button

How to Create a Reload Button which will Reload the Webpage upon Clicking using JavaScript

The following code will add a reload button to your webpage. This button will reload your webpage when clicked.

Place the following code in the body section of your webpage where you want to display the button

<form>
<INPUT TYPE="button" VALUE="Reload" onClick='parent.location="javascript:location.reload()"'>
</form>

Share

Create Close Window Button using JavaScript

Use the following code to add a button to your hml page which on click will close the browser window for that page.

<form>
<input type="button" value="Close Window" onClick="window.close()">
</form>

<a href="javascript:window.close()">Close Window</a>
 

Share