更多操作
Xp00000000(留言 | 贡献) 小无编辑摘要 标签:已被回退 |
Xp00000000(留言 | 贡献) 小无编辑摘要 标签:手工回退 |
||
第1行: | 第1行: | ||
<html> | <html> | ||
<style> | |||
.normal-style { | |||
-webkit-tap-highlight-color: transparent; /* 移除点击高亮 */ | |||
} | |||
</style> | |||
<script> | <script> | ||
function | function toggleColor(element) { | ||
element.classList.toggle("clicked-style"); | |||
// 更新文本内容 | |||
element.textContent = element.classList.contains("clicked-style") | |||
? "HD 10" | |||
: "IN 14"; | |||
// 存储状态 | |||
localStorage.setItem('boxState', element.classList.contains("clicked-style")); | |||
localStorage.setItem(' | |||
} | } | ||
// 页面加载时恢复状态和文本 | |||
// | window.onload = function() { | ||
var box = document.getElementById('myInteractiveBox'); | |||
if(box) { | |||
var isClicked = localStorage.getItem('boxState') === 'true'; | |||
box.classList.toggle("clicked-style", isClicked); | |||
box.textContent = isClicked | |||
? "HD 10" | |||
: "IN 14"; | |||
} | } | ||
}; | |||
</script> | </script> | ||
<div id="myInteractiveBox" class="normal-style" onclick="toggleColor(this)">IN 14</div> | |||
<div id=" | |||
</div> | |||
</html> | </html> |
2025年7月1日 (二) 21:13的版本
IN 14