我有一个div
与图像。当我按键盘上的按键时,我想要隐藏这些图像。我怎样才能做到这一点?更改div内容和刷新div时按键盘键
<div>
<span role="checkbox" aria-checked="true" tabindex="0">
<img src="checked.gif" role="presentation" alt="" />
</span>
</div>
<div>
<span role="checkbox" aria-checked="true" tabindex="0">
<img src="checked.gif" role="presentation" alt="" />
</span>
</div>
<div>
<span role="checkbox" aria-checked="false" tabindex="0">
<img src="unchecked.gif" role="presentation" alt="" />
</span>
</div>
这是div
与内容。我想要在keypress
事件中隐藏这些图像..!
用JavaScript – unconnected
需要Javascript为。有多个问题应该可以帮助你解决你的问题。如[这个答案](https://stackoverflow.com/a/16089470/2412895)或[这个答案](https://stackoverflow.com/questions/2554149/html-javascript-change-div-content)等 – KarelG
HTML代表内容,CSS代表样式,Javascript代表交互性。你有HTML,现在你需要Javascript。 – Clonkex