ShowAndHideElements

{{onText}}
ON

Javascript

//on element style var onStyle = "display: block;"; // on variable var on = true; // on off button text var onText = "OFF"; //When variable on changes, switch style and button text to match OpenForum.addListener("on", function() { if(on) { onStyle = "display: block;"; onText = "OFF"; } else { onStyle = "display: none;"; onText = "ON"; } }); //Toggle on variable on button click function toggleOn() { on=!on; }

Page Content

[{ActionButton text="{{onText}}" action="toggleOn"}] <div style={{onStyle}}>ON</div>