-
-
Notifications
You must be signed in to change notification settings - Fork 241
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
黑白主题切换 #416
Comments
<button>关灯</button>
<script>
var btn = document.querySelector('button');
var bd = document.querySelector('body');
btn.onclick = function () {
if (btn.innerHTML === '关灯') {
bd.style.backgroundColor = '#111';
btn.innerHTML = '开灯';
}
else {
bd.style.backgroundColor = '#fff';
btn.innerHTML = '关灯';
}
}
</script> |
纯css版本
|
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
No description provided.
The text was updated successfully, but these errors were encountered: