I am currently trying to utilize a toggle switch to determine which methods need to be activated. My expectation is that I can obtain a Boolean value indicating whether the switch is turned on or off. However, I am unsure of how to retrieve this information.
To address this issue, I have incorporated a toggle switch in my HTML code:
<label class="switch">
<input type="checkbox" id="ToggleswitchId" >
<span class="slider round"></span>
</label>
Additionally, I have observed another individual accomplish something similar using JavaScript:
var switchTrueFalse = document.getElementById('ToggleswitchId').checked
However, when attempting this method, I receive an error stating "Property 'checked' does not exist on type HTMLElement"