Problem with loop on IE8
<p>Hi i have this javascript function</p>

<pre><code>function test(){
            var count = 0;
            var date1 = $('#alternatestartdate').val();
            var date2 = $('#alternateenddate').val();                
            var startDate = new Date(date1);
            var endDate = new Date(date2);

            var loop = true;
            while (loop)
            {
            $('#pa').append('first test');                
            if (startDate&lt;=endDate)
            {
            $('#pa').append('second test');
            loop = true;                
            }
            startDate.setDate(startDate.getDate()+1);
            }
            else
            {
            loop = false;
            }                
            }                
        }
</code></pre>

<p>The problem is the function will not enter the if loop when tested in IE8. So only <strong>first test</strong> will be printed. <strong>second test</strong> will not be printed. Other browser all work fine. How to fix this? </p>
