Help me about these codes

you are using button when you should be using state...

apart from that, it should work as written.