How to have a simple pushbutton toggle bits

I am new to ignition perspective and I am trying to get a script for having a pushbutton toggle a bit when clicked, any help is appreciated.

Something like:

YourTag = not YourTag

Edit, this assumes you have a custom prop named YourTag

To elaborate a bit more:

  • Create a custom property on your button, call it target or something meaningful for your purpose.
  • Bind that custom property to your boolean tag, and set it to be bidirectional.
  • Add an actionPerformed script to your button with this:
	self.custom.target = not self.custom.target

Edit: You may also want to look at the toggle button component....

Perfect I got it thank you.