Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Onclick and href 1

Status
Not open for further replies.

AgentM

MIS
Jun 6, 2001
387
0
0
US
I am trying ot figure out the code for:-
When a image is clicked the window will load another page.
In other words the image should act as a href.

Can somebody please give me the onClick event for that image?
 
just suround the image with the href tags and the appropriate url to redirect _______________________________________________
[sub]{ str = "sleep is good for you. sleep gives you the energy you need to function";
ptr = /sleep/gi;Nstr = str.replace(ptr,"coffee");alert(Nstr); }[/sub]
_______________________________________________
for the best results to your questions: FAQ333-2924

 
If it has to be an onClick then use something like:

<html>
<head>
<script language=&quot;vbscript&quot;>
function click_function
location.href=&quot;end function
</script>
</head>
<body>
<img src=&quot;../images/rt.jpg&quot; onClick='click_function'>
</body>

</html>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top