On Off Button Web | Web Toggle Button | On-off Switch Web | Toggle Btn Web | Web On-off Control | Btn Onoff Web | Web On/off Functionality | Web Switch Btn | Html Control Button | Html Button Element | Button In Html | Html Control Btn | Btn Html | How Html Button? | Create Html Button | Html Button Code | Toggle Led Webpage | Switch Led On Web | Webpage Led Toggle | Toggle Light On Site | Led Control Page | Change Led Via Web | Flip Led On Site | Led Switch Website | Web Led Control | Web Led Controls | Led Web Control | Web Led Controller | Led Web Control System | Control Leds Via Web | Web-based Led Control | Led Control Online | Html Led Toggle Button | Html Led Toggle | Led Toggle In Html | Toggle Button Html | Html Code Led Toggle | Led Toggle Example Html | How To Toggle Led Html | Html Led Switch Btn

HTML / CSS / JS Open Kit Simulator ↗ All recipes
Tip: Ctrl+↵ to run
Live preview in a sandboxed iframe. Click Render preview to see the page rendered. JavaScript runs in a strict sandbox — fetch() to external sites may be blocked. For a dashboard talking to your Pi, click Open in new tab after editing.

About this recipe

Real Pi: fetch('/api/led/' + (state ? 'on' : 'off'))

Libraries / imports

No imports detected

Hardware / pins

No physical pins or components referenced

Key API calls

document.getElementById() addEventListener() fetch()

How to run

Press Render preview — renders live in a sandboxed iframe with mocked /api/*.
Editor html edits auto-save
Output ready
Output will appear here after you click Run.