Web Analytics Made Easy -
StatCounter Changing Table Background w/ links - CodingForum

Announcement

Collapse
No announcement yet.

Changing Table Background w/ links

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

  • Changing Table Background w/ links

    Hullo,

    Just looking for a simple script, I want to have 4 links that, when clicked, will change the back ground image of a table. Simple enough... but I don't know how. :P

    Thanks.
    Tombo out.

  • #2
    Try this,
    -----the script
    <script>
    function chgArrow(i){
    document.getElementById('tdImg').setAttribute("background",i);
    }
    </script>
    -----the table
    <table>
    <tr>
    <td><a href="javascript:chgArrow('images/image1.gif')">up</a></td>
    <td><a href="javascript:chgArrow('images/image2.gif')">Down</a></td>
    <td id="tdImg" background="images/default.gif" nowrap>----content here------</td>
    </tr>
    </table>

    script run for DOM browser only, i try with IE6 and NN6

    Comment

    Working...
    X