我想仅在单击特定按钮时才显示特定的 div。就像如果单击带有id#newLD的按钮一样,则应显示id为#createLD的唯一div,而其他div应保持隐藏状态。我创建的所有三个按钮都需要相同的功能。
附言 - 我检查了堆栈溢出的其他解决方案,但代码不适合我。它们使它看起来太复杂了。请帮助并建议初学者可以理解的最简单的方法。
button {
padding: 20px;
margin: 0 5px 0 0;
border: 0 solid;
text-transform: uppercase;
letter-spacing: 1.5px;
color: #999999;
}
<div id="button-container">
<button id="newLD" class="myButton">Logo</button>
<button id="newVC" class="myButton">Visiting Card</button>
<button id="newFD" class="myButton">Flyer Design</button>
</div>
<div id="createLD" style="display: none">
<p>Here is the lofo design div</p>
</div>
<div id="createVC" style="display: none">
<p>Here is the visitng card design div</p>
</div>
<div id="createFD" style="display: none">
<p>Here is the flyer design design div</p>
</div>
繁华开满天机
狐的传说
达令说
相关分类