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
    Regular Coder
    Join Date
    Jun 2002
    Posts
    905
    Thanks
    23
    Thanked 5 Times in 5 Posts

    div.style is null or not object?

    hi again all,

    On click the following function runs:

    function ddiv14() {
    ddiv14.style.display='';
    }
    I get an error saying that ddiv14.style is null or not an object ... I dont understand, it is blank above but that is so that I can show the div after it has been display=none.

    any thoughts?
    many thanks

  • #2
    Senior Coder
    Join Date
    Aug 2002
    Location
    UK
    Posts
    2,789
    Thanks
    2
    Thanked 14 Times in 14 Posts
    You should be referencing as

    document.getElementById("ddiv14").style.display='';


    It could also be that you are also using ddiv14 as the function name, change the function name
    The silent one.

    The most dangerous thing in the world is an idea.
    The most dangerous person in the world is the one with an idea.


  •  

    Posting Permissions

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