admin管理员组文章数量:1279043
I am developing a iOS Safari Extension and in my popup I have a checkbox. I am listening to when the box is clicked by adding event listener on the click on the input element itself. Below is a snippet of the code
popup.html
<body>
<div class="container">
<h1>Checkbox Demo</h1>
<div class="toggle-container">
<input type="checkbox" id="checkBoxID">
</div>
</div>
</body>
popup.js
document.addEventListener('DOMContentLoaded', () => {
document.querySelector('#checkBoxID').addEventListener('change', saveOptions);
});
The behavior I am seeing currently is if I click the checkbox once the saveOptions
event handler gets executed however the state of the checkbox does not change ie the check does not appear on the DOM. If I click the checkbox again the check appears but the function event handler does not run.
本文标签: iphoneSafari iOS Extension Double click for checkboxStack Overflow
版权声明:本文标题:iphone - Safari iOS Extension Double click for checkbox - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741302272a2371158.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论