Results 1 to 3 of 3

Thread: [Resolved] How to change table row color with JavaScript

Threaded View

  1. #1

    Thread Starter
    Member
    Join Date
    May 2004
    Posts
    38

    Resolved [Resolved] How to change table row color with JavaScript

    Hi, all,

    I have a question about javasrcipt. The following HTML page has a table composed of three rows. I wish to know how to find the yellow row and change its bgcolor to red? Use javascript.

    Thank you very much for any suggestion!
    xihu24


    Code:
    <html>
    <script lauguage="javascript">
    function findYellowRow(){
       // implementation to change the row from yellow to red
       // ?
    }
    </script>
    
    <body>
    <table>
    <tr bgcolor=white><td>1</td></tr>
    <tr bgcolor=yellow><td>2</td></tr>
    <tr bgcolor=white><td>3</td></tr>
    </table>
    
    <form>
    <input type="button" value="FindYellowRow" onClick="findYellowRow();">
    </form>
    </body>
    </html>
    Last edited by xihu24; Oct 29th, 2004 at 04:32 PM.

Posting Permissions

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



Click Here to Expand Forum to Full Width