更多操作
Xp00000000(留言 | 贡献) 小无编辑摘要 |
Xp00000000(留言 | 贡献) 小无编辑摘要 |
||
第12行: | 第12行: | ||
// 更新文本内容 | // 更新文本内容 | ||
element.textContent = element.classList.contains("clicked-style") | element.textContent = element.classList.contains("clicked-style") | ||
? " | ? "HD 10" | ||
: " | : "IN 14"; | ||
// 存储状态 | // 存储状态 | ||
localStorage.setItem('boxState', element.classList.contains("clicked-style")); | localStorage.setItem('boxState', element.classList.contains("clicked-style")); | ||
第24行: | 第24行: | ||
box.classList.toggle("clicked-style", isClicked); | box.classList.toggle("clicked-style", isClicked); | ||
box.textContent = isClicked | box.textContent = isClicked | ||
? " | ? "HD 10" | ||
: " | : "IN 14"; | ||
} | } | ||
}; | }; | ||
</script> | </script> | ||
</html> | </html> | ||
<div id="myInteractiveBox" class="normal-style" onclick="toggleColor(this)"><div style="width: 64px; height: 32px; background-color: #FE8661; border-radius: 16px; display: flex; align-items: center; justify-content: center; color: white; font-size: 16px;">IN 14</div></div> | |||
<div id="myInteractiveBox" class="normal-style" onclick="toggleColor(this)"> | |||
</div> |
2025年7月1日 (二) 21:03的版本
IN 14