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 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Jun 2004
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    javascript, changin style of span

    Ok, hi everyone. Ive been working with javascript for a year or two now, but ive never realy written anything. I know PHP, ASP, all that fun stuff, but I always crash when it comes to JavaScript. What im trying to do, is change the style of a <span> tag i have.
    Code:
    <script language="javascript">
    function expand(thing) {
    	document.getElementById(thing).innerHTML="HE";
    }
    </script>
    i did that to see if it was accualy getting the right span tag, and it did. so then i tried:
    Code:
    <script language="javascript">
    function expand(thing) {
    	document.getElementById(thing).style="display:none";
    }
    </script>
    it didnt like that, it said member not found or something to that effect.

    thanks in advancd

  • #2
    New Coder
    Join Date
    Oct 2002
    Posts
    23
    Thanks
    0
    Thanked 0 Times in 0 Posts
    try
    Code:
    function expand(thing) {
      document.getElementById(thing).style.display = "none";
    }

  • #3
    New to the CF scene
    Join Date
    Jun 2004
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    ah, thank you, it worked.

    thanks again

  • #4
    New Coder
    Join Date
    Oct 2002
    Posts
    23
    Thanks
    0
    Thanked 0 Times in 0 Posts
    My pleasure. I wrestled with the exact same problem until someone, on this forum I think, pointed me towards my folly. Just doing my part to pay-it-forward.


  •  

    Posting Permissions

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