Well, what I'm trying to make is a button that will cycle through commands. See I'm trying to make something that will sort the reviews on my website in different orders when someone clicks a button. (here's a link to
my website to kinda get an idea of what I'm trying to do) What I'm using right now though isn't very good 'cause I can't make any changes to the reviews. So I'm trying to find a new way and what I got is this code:
<script>
function fnSwap(){
oList.children(0).swapNode(oList.children(1)); oList.children(2).swapNode(oList.children(3));
}
</SCRIPT>
<UL ID = oList>
<LI>List Item 1
<LI>List Item 2
<LI>List Item 3
<LI>List Item 4
</UL>
<INPUT TYPE = button VALUE = "Swap List" onclick = "fnSwap()">
That'll swap list items.
It's gonna take a long time to put all 20 of the reviews(on each page) in the right order but it's the best thing I got so far. If anyone knows of ANYTHING that will work better to do what I'm trying to do PLEASE let me know.
But in the mean time, I need to know if there is a way I can, for example, make it to where if they click the button it'll swap list items number 1 and 2, and then if they click it again it'll swap items 3 and 4, and if they push it again it will start all over and keep cycling through that pattern.
(I hope i'm explaining this ok. If you don't get it let me know.)