SitePoint Sponsor

User Tag List

Results 1 to 8 of 8

Hybrid View

  1. #1
    SitePoint Zealot shiftless's Avatar
    Join Date
    Mar 2005
    Posts
    137
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question onclick script not working

    can someone tell me why my onclick javascript (in link tag) isn't working? i used the same code in a flash getURL command and it worked fine but not in this html link:

    Code:
    <div id="about">
    <h1>ABOUT</h1>
    <div id="rightside">
    	<img src="images/about_crop" />
    </div>
    <p>one paragraph</p>
    <p>click <a href="#" onclick="document.getElementByID('about')style.display='none';" onfocus="this.blur();">here</a> to make this text disappear.</p>
    </div>

  2. #2
    SitePoint Enthusiast
    Join Date
    Jul 2007
    Location
    Virginia
    Posts
    87
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Why I don't like javascript.

    Code:
    document.getElementById('about').style.display='none';
    Mark A. Drake
    - Mark A. Drake
    - OnSlaught

  3. #3
    SitePoint Zealot shiftless's Avatar
    Join Date
    Mar 2005
    Posts
    137
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    hmmm

    thanks for catching that, but it still doesn't work. check the page here:

    http://www.aftermath-creative.com/te...ure/index.html

  4. #4
    SitePoint Enthusiast
    Join Date
    Jul 2007
    Location
    Virginia
    Posts
    87
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by shiftless View Post
    thanks for catching that, but it still doesn't work. check the page here:

    http://www.aftermath-creative.com/te...ure/index.html
    Sorry I didn't point out that I changed 'ID' to 'Id'.

    Check out the page using firefox, which will give you better error messages in regards to javascript problems. I have to do things like this constantly - probably did it about 45 times this morning :/.
    Mark A. Drake
    - Mark A. Drake
    - OnSlaught

  5. #5
    SitePoint Enthusiast
    Join Date
    Jul 2007
    Location
    Virginia
    Posts
    87
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    edit
    Mark A. Drake
    - Mark A. Drake
    - OnSlaught

  6. #6
    SitePoint Zealot shiftless's Avatar
    Join Date
    Mar 2005
    Posts
    137
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ah, didn't see that, thanks. i am using firefox but don't get any error messages. what do i have to do to set that up?

  7. #7
    SitePoint Enthusiast
    Join Date
    Jul 2007
    Location
    Virginia
    Posts
    87
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Mark A. Drake
    - Mark A. Drake
    - OnSlaught

  8. #8
    SitePoint Enthusiast
    Join Date
    Nov 2006
    Posts
    99
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You are probably confusing browser with two inline js code in onclick and onfocus. Also I think that it's strange to use onfocus in link... What do you want to achieve? How function blur() looks like?


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
  •