Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

handler for onclick

 
Gilles Charbonneau
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello pples!
I have made small code allowing text in a table row to change color on mouse overs, that part goes well but i am havin problems making the link (onclick) part workin, help would be greatly apreciated!
Here's the code
< !DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN">
< html>
< head>
< title>Untitled Document< /title>
< meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
< /head>
< body bgcolor="#FFFFFF" text="#000000">
< table width="300" border="1" cellspacing="0" cellpadding="0" height="255">
< tr>
< td width="100" height="100">�< /td>
< td width="100" height="100">�< /td>
< td width="100" height="100">�< /td>
< /tr>
< tr>
< td width="100" height="100">�< /td>
< td bgcolor="#FFCC00" width="150" <br /> onmouseover="this.style.color='#ff0000'" <br /> onmouseout="this.style.color='#0000ff'" <br /> onclick="this.href='http://www.altavista.com'"> ***** not working *****
< center>< b>Link1< /b>< /center>
< /td>
< td width="100" height="100">�< /td>
< /tr>
< tr>
< td width="100" height="100">�< /td>
< td width="100" height="100">�< /td>
< td width="100" height="100">�< /td>
< /tr>
< /table>
< /body>
< /html>
[This message has been edited by Gilles Charbonneau (edited June 23, 2001).]
 
Cindy Glass
"The Hood"
Sheriff
Posts: 8521
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Perhaps if you put some spaces after your angle brackets so that this html doesn't EXECUTE this might be easier to read .
 
Cindy Glass
"The Hood"
Sheriff
Posts: 8521
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, I an no HTML expert by any means, but I thought that that is what anchor tags are for.
onmouseover="this.style.color='#ff0000'"
onmouseout="this.style.color='#0000ff'"
< center>< b>< a href="http://www.altavista.com">Link1< /a>< /b>< /center>
You know we have an HTML forum for questions like this. Randy does LOTS more with this stuff than I do.
[This message has been edited by Cindy Glass (edited June 23, 2001).]
 
Gilles Charbonneau
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello again!
thanks for the help but this isnt what i ment
What i wanna do is to make the table row clickable!
------------------
 
Jim Yingst
Wanderer
Sheriff
Posts: 18671
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, the comment about the HTML forum is still valid. Why not post in a forum which specializes in what you're doing?
 
Dan
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

That should cover you. on-click shouldn't have a dash, but this @#$@#$ forum wouldn't take my post.
 
Cindy Glass
"The Hood"
Sheriff
Posts: 8521
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Dan, Welcome to the Java Ranch,
we hope you’ll enjoy visiting as a regular however, your name is not in keeping with our naming policy here at the ranch. Please change your display name to an appropriate name as shown in the policy.
Thanks again and we hope to see you around the ranch!!
Cindy
 
Thomas Paul
mister krabs
Ranch Hand
Posts: 13974
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving this to the HTML forum.
 
Rob Hunter
Ranch Hand
Posts: 832
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Gilles,
I haven't used this much but have you tried using the <div> tag. I'm not 100% sure if <td> tags use onclick events since I've never had any use of onclicks for this type of case.
Rob
 
Charlie Sturman
Ranch Hand
Posts: 112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
change this.href to window.location
"window.location='http://www.altavista.com'"
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic