Let's say I have a page containing the following:

<DIV class="element" ID="0"> 1</DIV>
<DIV class="element" ID="1"> 1</DIV>
<DIV class="element" ID="2"> 1</DIV>
<DIV class="element" ID="3"> 1</DIV>
<DIV class="element" ID="4"> 1</DIV>
<DIV class="element" ID="5"> 1</DIV>
<INPUT type="button" ID="randomize" VALUE="click me!">

and I want to randomize the order these divs appear on the screen,
mapped to the button's click event.

I can capture the click event, get a count for the number of elements,
make an array with the same length and then randomize the keys....but
is there a way to set a new index on an element?



Reply via email to