[英]Checkbox toggle in Chrome and Opera
Steps to reproduce the issue: 重现此问题的步骤:
Settings
select Continue where you/I left off
under On startup
. 在浏览器的Settings
, On startup
Continue where you/I left off
下选择Continue where you/I left off
。 Now as you see the checkbox is checked, but the textarea isn't colored. 现在,如您所见,该复选框已选中,但文本区域未着色。
I tried it in the latest version of Chrome and Opera in Windows 10. I'm not sure about Safari, but it probably behaves the same way. 我在Windows 10的最新版本的Chrome和Opera中进行了尝试。我不确定Safari,但其行为可能与以前相同。
Questions: 问题:
Try 尝试
window.onload = function() {
document.getElementById('colorsToggle').onchange = function() {
document.getElementById('textField').classList.toggle('tan');
}
document.getElementById('textField').classList.toggle(document.getElementById('colorsToggle').checked ? "tan" : "white");
};
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.