...

View Full Version : <li> innerHTML problem in IE.



codegoboom
08-22-2004, 04:17 AM
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>

A1ien51
08-22-2004, 04:54 AM
Run this and it will show you why the statement is not equal....



<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

codegoboom
08-22-2004, 05:04 AM
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! :mad:



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum