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 3 of 3
  1. #1
    Regular Coder
    Join Date
    Aug 2004
    Location
    codegoboom@yahoo.com
    Posts
    999
    Thanks
    0
    Thanked 0 Times in 0 Posts

    <li> innerHTML problem in IE.

    What's going on here? (acts like a bug)

    <ul>
    <li
    onclick="alert(this.innerHTML);
    alert(this.innerHTML=='Hello World!');
    this.innerHTML='Hello World!';
    alert(this.innerHTML=='Hello World!')">Hello World!</li>
    </ul>
    *this message will self destruct in n-seconds*

  • #2
    Senior Coder A1ien51's Avatar
    Join Date
    Jun 2002
    Location
    Between DC and Baltimore In a Cave
    Posts
    2,717
    Thanks
    1
    Thanked 94 Times in 88 Posts
    Run this and it will show you why the statement is not equal....

    Code:
    <ul>
    <li 
    onclick="alert(this.innerHTML);
    alert(escape(this.innerHTML));
    alert(escape(this.innerHTML)=='Hello World!')">Hello World!</li>
    </ul>
    Notice the extra space...

    Eric
    Tech Author [Ajax In Action, JavaScript: Visual Blueprint]

  • #3
    Regular Coder
    Join Date
    Aug 2004
    Location
    codegoboom@yahoo.com
    Posts
    999
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Yeah, thanks; I had just thought to try something similar...

    <ul>
    <li onclick="alert(this.innerHTML.charCodeAt(5));alert(this.innerHTML.charCodeAt(12))">Hello World!</li>
    </ul>


    That blows!
    *this message will self destruct in n-seconds*


  •  

    Posting Permissions

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