我正在尝试在没有 Jquery 的情况下执行此操作。我想在单击触发器时显示一个 div。到目前为止,我有这个来隐藏元素。
document.getElementById('element').style.display = 'none';
HTML..
<div class="element">Ahem, boo!!</div>
<a href="#" id="showDiv">Show</a>
单击链接时如何创建显示 div 的函数?我想避免使用onclick="showDiv()
链接本身的功能。