You are not logged in.

1

Monday, April 3rd 2023, 1:23pm

switch two actions

Please tell me how to switch two actions many times

Source code

1
2
onclick="switch(set, action_1();,action_2(););"
action_1();action_2();

2

Monday, April 3rd 2023, 3:43pm

what do you mean by switch actions ?
execute #1 then #2 then #1, etc ?

3

Monday, April 3rd 2023, 4:08pm

Yes, 1, 2, 1, 2...

4

Monday, April 3rd 2023, 4:29pm

Found a solution that might help someone

Source code

1
2
			onclick="switch(state,1,2);"
			if(state == 1				,action_1(); 					,action_2();			);		

5

Monday, April 3rd 2023, 5:27pm

Source code

1
onclick="switch(action_x,0,1);if(action_x,action_2(),action_1());"