Pages

onclick = open page in new window

A couple of pieces of code I have been trying to use today:

This one creates a button, which when clicked, opens a new page in the same window.

    <form><input onclick=”location.href=(‘http://www.abcdiamond.com’)” type=”button” value=”Details of link…” /></form>

This next one creates a button, which when clicked, opens a new page in a NEW window.

    <form><input onclick=”window.open(‘http://www.abcdiamond.com’)” type=”button” value=”Details of link…” />

This next one creates a button, which when clicked, closes the current window.

    <form method=”post”><input onclick=”window.close()” type=”button” value=”Close this Window” /></form>

To centre these buttons in a table, the code <center> must be placed after the code <form>.

    <form><p align=”center”><input onclick=”location.href=(‘http://www.abcdiamond.com’)” type=”button” value=”Details of link…” /></form>


Leave a Reply

  

  

  


*

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>