SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Hybrid View

  1. #1
    SitePoint Addict
    Join Date
    Apr 2007
    Posts
    211
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Change font color of table cells individually.

    This doesn't work, what am I doing wrong?
    Code:
    <select onChange="this.parentNode.fgColor = this.options[this.selectedIndex].value;" name="font_color_cell1" size="1">
    I've tried various combinations of style, id, parentNode, and others but still no luck.

  2. #2
    SitePoint Guru Ize's Avatar
    Join Date
    Nov 2005
    Location
    The Netherlands
    Posts
    808
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    fgColor is not a valid property. You need style.color.

  3. #3
    SitePoint Addict
    Join Date
    Apr 2007
    Posts
    211
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks!
    Code:
    <select onChange="this.parentNode.style.color = this.options[this.selectedIndex].value;" name="font_color_cell1" size="1">


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •