How do I do this properly? Right now I am getting looping states.
On page load State = 0
if State = 0 set it to 1
if State = 1 set to 2
if State = 2 set to 0
I am using the states to sort a list and using an icon to do like a - ^ v type thing.
I want it to stop after the state is changed once.