Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Jan 2004
    Location
    undefine
    Posts
    29
    Thanks
    0
    Thanked 0 Times in 0 Posts

    SOS!How can I get "tr" bgcolor?

    I want to chang "tr" bgcolor when doble-click it, but I fail because I can not get "tr" bgcolor.The codes appear like this:
    <html>
    <body>
    <table width="200" border="1">
    <tr bgcolor="#FFFFFF" id="tr" align="center" onDblClick="alert(tr.align);alert(tr.bgcolor)">
    <td>&nbsp;</td>
    </tr>
    </table>
    </body>
    </html>
    undefine

  • #2
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,048
    Thanks
    0
    Thanked 251 Times in 247 Posts
    Should be:

    <tr bgcolor="#FFFFFF" id="tr" align="center" ondblclick="alert(this.bgColor)">

    But you must start now to learn and apply CSS in favor of old attributes like align and bgcolor.

    <tr style="background-color:#FFFFFF;text-align:center" ondblclick="alert(this.style.backgroundColor);alert(this.style.textAlign);">


  •  

    Posting Permissions

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