www.webdeveloper.com
Results 1 to 3 of 3

Thread: How can i get this Javascript to work

  1. #1
    Join Date
    Oct 2004
    Posts
    10

    Unhappy How can i get this Javascript to work

    Hi,

    I am a newbie and I am stuck in this script can someone help me please,

    Javescript:

    function toggleT( objName, swi )
    {
    var theObj = docuemnt.getElementById(objName);
    ( swi == "s" ) ? theObj.style.visibility='visible' :
    theObj.style.visibility='hidden';
    }

    HTML code:

    <span id="course" onClick="toggleT('divtag58','s')" onMouseOut="toggleT('divtag58','h')">Designing w/Computers I</span></font></strong><span id="divtag58">
    check check check<font color="#666666">woow</span>

    this does not work. I think it something to do with Javascript and I can't figure whats wrong. It should work in all browsers.

    Thanks in advance

  2. #2
    Join Date
    Jul 2004
    Location
    Canada, eh
    Posts
    784
    Code:
    var theObj = docuemnt.getElementById(objName);
    should be "document' not docuemnt

    And for the future, please post javascript questions in the javascript forum... It's just down the hall
    Last edited by HaganeNoKokoro; 10-12-2004 at 11:48 AM.
    Kids, kids... you tried your best, and you failed miserably; the lesson is: never try.

  3. #3
    Join Date
    Oct 2004
    Location
    The very depths of programming hell
    Posts
    828
    We don't want javascript scum invading our nice civilised java forum! go away!
    >I suck at this game, can you give me some pointers?

    >> 0x278AB4FF, 0xB5822BB4, 0xAD6E673D.

    > I hate you.


Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles