TR background

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Gandalf

    TR background

    I recently discovered that TR can have background property in simple
    html and in CSS but when i tried to reach TR element through
    javascript document.getEle mentById(TR_id) .style.backgrou nd or
    document.getEle mentById(TR_id) .background it doesn't work.

    someone know how can I reach this property through javascript

    p.s (in this case i can't use the td class name to reach a specific
    row background like this :

    if(document.get ElementsByTagNa me('td')[x].headers=='clas s_'+z)
    document.getEle mentsByTagName( 'td')[x].style.backgrou nd=' '
    )

    thanks !
  • Michael White

    #2
    Re: TR background

    Gandalf wrote:
    I recently discovered that TR can have background property in simple
    html and in CSS but when i tried to reach TR element through
    javascript document.getEle mentById(TR_id) .style.backgrou nd or
    document.getEle mentById(TR_id) .background it doesn't work.
    document.getEle mentById(TR_id) .style.backgrou ndColor="red"
    >
    someone know how can I reach this property through javascript
    >
    p.s (in this case i can't use the td class name to reach a specific
    row background like this :
    >
    if(document.get ElementsByTagNa me('td')[x].headers=='clas s_'+z)
    document.getEle mentsByTagName( 'td')[x].style.backgrou nd=' '
    )
    >
    document.getEle mentsByTagName( 'td')[x].style.backgrou ndColor="white"

    document.getEle mentsByTagName( 'td')[x].parentNode.sty le.backgroundCo lor="green"
    thanks !
    Mick

    Comment

    • Gandalf

      #3
      Re: TR background

      On Apr 14, 9:50 pm, Gandalf <goldn...@gmail .comwrote:
      I recently discovered that TR can have background property in simple
      html and in CSS but when i tried to reach TR element through
      javascript document.getEle mentById(TR_id) .style.backgrou nd or
      document.getEle mentById(TR_id) .background it doesn't work.
      >
      someone know how can I reach this property through javascript
      >
      p.s (in this case i can't use the td class name to reach a specific
      row background like this :
      >
      if(document.get ElementsByTagNa me('td')[x].headers=='clas s_'+z)
      document.getEle mentsByTagName( 'td')[x].style.backgrou nd=' '
      )
      >
      thanks !
      OK don't pay etention to this message TR can be reached by javascript

      Comment

      Working...