Toggle Button

Example toggling text using JavaScript.

Preview

Code

<button onclick="this.innerText = this.innerText === 'ON' ? 'OFF' : 'ON';">
OFF
</button>

More HTML Buttons Examples (7)