View Single Post
Old 01-10-2010, 07:06 AM   PM User | #1
huylord
New to the CF scene

 
Join Date: Jan 2010
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
huylord is an unknown quantity at this point
Question Javascript not working in IE

My Body looks like this:
Code:
<body>
<div class="postprofile" id="profile1">
        <span style="white-space:nowrap;">
                   <span style="color:#536482;">Posts</span>: </span> 5
   <br />
</div>
</body>
I want to get the number 5 so I use this javascript:
Code:
x = document.getElementsByTagName('div')
For(y=0;y<x.length;y++)
{
If(x[y].className == "postprofile"){
A= x[y].innerHTML;
B=parseInt(x[y].innerHTML.split("Posts</span>: </span> ")[1]);
Document.write(B);
                                                   }
}
And it worked fine in Firefox, but not in IE. Can anybody help me with this??
huylord is offline   Reply With Quote