Compare text with innerHTML IE7 problem

Posted by Beefo on Stack Overflow See other posts from Stack Overflow or by Beefo
Published on 2009-11-11T21:16:13Z Indexed on 2010/05/27 21:01 UTC
Read the original article Hit count: 154

Filed under:
|
|

I can't find a work around for the innerHTML bug in IE7. I need to look at the contents of dynamicly generated HTML and change it if the text is "-1". I'm using the prototype js gallery but couldn't find a fix. Any ideas?

JS:

<script language="javascript" type="text/javascript">
    Event.observe(window, 'load', function () {
	var num = 1;
	var allAccountInfoItems = $A('accountInfoItem');
	var numofElements = (allAccountInfoItems.length);

	for (var x = 0; x < numofElements; x++ )
	{
		var oldHTML = $('accountInfo').innerHTML;
		var newHTML = "Unlimited";

		if (oldHTML == "-1")
		{
			$('accountInfo').update(newHTML);  
		}

		var oldId = $('accountInfo').id;
		var numPlus = num++;

		$('accountInfo').id = oldId + numPlus;
	}

});
</script>

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about prototype