Help Please - how do I load a new HTM page using onClick

D

DK

I am very new to JS and trying to use a button to move on to a new html page
rather than a text link.

The code I have is as follows; (having tried to wrap the button in a HREF)

<A HREF="index.htm">

<input type='button'
id='Button2'
name='Button2'
style='width:146px;height:46px;border:1px#000000

solid;background-color:#FFFF99;color:#000033;font-family:Verdana;font-size:1
0pt;'
value='INDEX'
onClick='return true;'
</input>
</A>

This does not work not sure why, I originally tried calling a js function
jsLoad() to load a new page but don't quite know how to do this?

<SCRIPT LANGUAGE=javascript>
<!--
function jsLoad()
{

don't know what to put here !!!!!

}
//-->
</SCRIPT>

Any help on this would be much appreciated.

Regards

David
 
D

David Dorward

DK said:
I am very new to JS and trying to use a button to move on to a new html
page rather than a text link.

I really hope that this is a learning exercise. Using JS to simulate things
that can be done in HTML is not a good idea.
The code I have is as follows; (having tried to wrap the button in a
HREF)

So is the objective to use a button as a link? Don't, use a link as a link
and then style it to look how you want.

http://tom.me.uk/2002/8/css-buttons.html
This does not work not sure why, I originally tried calling a js function
jsLoad() to load a new page but don't quite know how to do this?

<SCRIPT LANGUAGE=javascript>
<!--
function jsLoad()
{

don't know what to put here !!!!!

Set document.location to the URI you want.
 
J

Janwillem Borleffs

DK said:
I am very new to JS and trying to use a button to move on to a new html page
rather than a text link.

<input type="button" onclick="location='index.htm'" value="INDEX" />


JW
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,576
Members
45,054
Latest member
LucyCarper

Latest Threads

Top