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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

OnClick: Act like hyperlink 3

Status
Not open for further replies.

BoulderBum

Programmer
Jul 11, 2002
2,179
US
This one should be easy (I think) but googling OnClick and link/hyperlink gets a bunch of stuff about, well, hyperlinks.

Basically I have a cell of a table I want to add an OnClick event handler to. In the event, I simply want to direct the user to a different page (as if they just clicked a hyperlink).

How do I do it?
 
Thanks, man.

Googling "redirect" would have found it.

Is there any difference between "window.location" and "window.location.href"?
 
No, href is the default property for the location object.
 
You can also use a style to make it look like clickable.

<td style="cursor:hand">not-a-link</td>

This lets users know the cell is hot if they hover over it.
 
spc,

Thanks.

thedrider,

Great tip! Thanks. I actually do that now, but I found out the hard way that "cursor:pointer" is the way to go for cross-browser compatibility.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top