jQuery data() method resetting previously set data in a loop
<p>OK, so I'm trying to store two pieces of data in a bunch of anonymous divs that are being appended to a parent div:</p>

<pre><code>var $timepicker = $('&lt;div class="timepicker"&gt;&lt;/div&gt;');
var startTime = new Date(0, 0, 0, 0, 0, 0, 0);
var endTime = new Date(0, 0, 0, 23, 60 - settings.step, 0, 0);

for (var time = startTime; time &lt;= endTime; time.setMinutes(time.getMinutes() + 30)) {
    $timepicker.append($('&lt;div&gt;&lt;/div&gt;').data('time', time));
}
</code></pre>

<p>However, after running the for loop, the value of data('time') is always equal to the last time's value, for each and every div (whereas it should be equal to the time that it was originally set to, obviously). I've scoured the interweb for clues, but no one else seems to be having this problem. What the heck's going on? Is it because I'm using anonymous divs? Your help is much appreciated.</p>

<p>Thanks,</p>

<p>Daniel</p>
