SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Thread: Javascript Help

  1. #1
    SitePoint Member
    Join Date
    Nov 2008
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Javascript Help

    Am new to Javascript and need help.....

    My Web Page displays the result in the following table format:

    Name HostName

    cold a
    b
    c

    bold d
    e
    f


    I want to Hide HostName contents and use javascript with following condition: when the cursor is over cold, then the Contents are displayed....The same with bold....and for any other rows which will follow, as the tbale will grow....

    Any Help......
    Last edited by manik112; Nov 16, 2008 at 01:14. Reason: Formated the table

  2. #2
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,604
    Mentioned
    24 Post(s)
    Tagged
    1 Thread(s)
    What JavaScript do you have so far?
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  3. #3
    SitePoint Member
    Join Date
    Nov 2008
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This is what I was playing with:
    <html>
    <head>
    <script>
    function toggle() {
    if( document.getElementById("hidethis").style.display=='none' ){
    document.getElementById("hidethis").style.display = '';
    }else{
    document.getElementById("hidethis").style.display = 'none';
    }
    }
    </script>
    </head>
    <body>

    <span onClick="toggle();">toggle</span><br /><br />

    <table border="1">
    <tr>
    <td>Always visible</td>
    </tr>
    <tr >
    <td>Hide this</td>
    </tr>
    <tr>
    <td>Always visible</td>
    </tr>
    </table>

    </body>
    </html>


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
  •