[Javascript] Comparing Strings

Timothy White weirdit at gmail.com
Thu Aug 25 05:26:57 CDT 2005


> 1. innerHTML is a non-standard, MS-proprietary property which, although
> supported as a convenience by other browsers, doesn't have a standard
> defined behaviour;
> 
> 2. When you read the innerHTML property you are getting the string after
> it has been parsed by the browser, so although the string returned may be
> semantically identical to the value that was stuffed in there, it's
> possible that whitespace has been changed around (for example, duplicate
> spaces could have been stripped) with the result that the two strings are,
> in fact, different. Another possibility is that any HTML elements
> contained in the element whose innerHTML property you are reading would be
> returned with their tag names in upper case, but the initial value with
> which you are comparing has tag names in lower case.

Ok, so done the alert thing and yes the formatting is different.
Nothing to do with case though so I can't fix it that easily.

So what should I use instead of innerHTML?

Thanks

Tim



More information about the Javascript mailing list