I am having trouble with a toggle round button and the corresponding JavaScript that I have implemented. It seems like the switch does not move, even though when I tested the link to the JS file with an alert it did work.
let touchIdN = document.getElementById('touchidN');
let touchIdY = document.getElementById('touchidY');
touchIdN.hidden = false;
touchIdY.hidden = true;
let enableTouchId = () => {
touchIdY.hidden = false;
touchIdN.hidden = true;
}
let disableTouchId = () => {
touchIdY.hidden = true;
touchIdN.hidden = false;
}
touchIdN.onclick(enableTouchId);
touchIdY.onclick(disableTouchId);
In my HTML code, #touchidY is set to display hidden using CSS for both options.
<tr>
<td><img src='./icons/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="6f090601080a1d1f1d06011b2f5d17411f0108">[email protected]</a>'></td>
<td>Enable Touch ID</td>
<td>
<label class="switch" id='touchidN' onclick='enableTouchId()'>
<input type="checkbox">
<span class="slider-round"></span>
</label>
<label class="switch-yellow" id='touchidY' onclick='disableTouchId()'>
<input type="checkbox">
<span class="slider-back"></span>
</label>
</td>
</tr>
The aforementioned code is included within a table in my HTML page.