Web Analytics Made Easy -
StatCounter Using a cell as a link in JavaScript - CodingForum

Announcement

Collapse
No announcement yet.

Using a cell as a link in JavaScript

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Using a cell as a link in JavaScript

    Without using images, is there a way (in JavaScript obviously) to use an entire cell as a "clickable" link, instead of JUST the text link within the cell?

    Thanks

  • #2


    onclick="window.location='URL'">

    Last edited by adios; Jul 3, 2002, 01:55 PM.

    Comment


    • #3
      Do you know what the method is for a link though? That link just has an example for changing the color of the cell (this.bgColor). I am trying to use the cell as a link, as well as the text within it.

      Thanks

      Comment


      • #4
        Hmm....

        onclick="window.location='URL'">

        Comment


        • #5
          Okay, well I hope I'm not missing something, because it doesn't seem to be working. Here is the small code for the cell:

          <td bgcolor="#999999" onMouseOut="this.style.backgroundColor=' ';" onMouseOver="this.style.backgroundColor='#999999';" onClick="window.location='contact.html';">
          <a class="hdr" href="contact.html">Contact</a></td>

          Anything wrong jump out at you?

          Thanks

          Comment


          • #6
            Please disregard the accidental semi-colons at the end of each JavaScript method...they've been removed.

            Comment


            • #7
              No jumping. A few stylistic alterations:

              <td style="cursor:hand;"
              onmouseout="this.style.background=''"
              onmouseover="this.style.background='#999999'"
              onclick="window.location='contact.html'">
              <a class="hdr" href="contact.html">Contact</a></td>

              Comment


              • #8
                Thanks, it works!

                Comment


                • #9
                  xmlns:xlink="http://www.w3.org/1999/xlink" xlink:type="simple" xlink:href="contact.html"



                  Probably Gecko-only though, unless Amaya supports simple XLinks.
                  jasonkarldavis.com

                  Comment

                  Working...
                  X