Switch

To use the switch in a dizmo, include the compiled CSS and JS files after the DizmoElements core css file.

<link rel="stylesheet" href="/styles/dizmoelements-2.0.css"></link>
<link rel="stylesheet" href="/styles/dizmoelements-switch-2.0.css"></link>
<script src="/scripts/dizmoelements-switch-2.0.js"></script>

Once included, you can use the <dizmo-switch> element as you would use the <input type="checkbox"> element in regular html.

<dizmo-switch id="switch"></dizmo-switch>

Add event listeners as for <input type="checkbox">.

document.getElementById("switch").addEventListener("click", ...)