To replace childElementCount with children.length since childElementCount is not supported in Internet Explorer 8.