How do I trigger the display of a <div>
by clicking on a <li>
element?
<ul id="courseNav">
<li class="title"><a href="#">Overview</a></li>
<hr style="margin-top: -0.8px">
<li class="topics" style="margin-top: -12px"><a href="#">Topic</a></li>
<li class="topics"><a href="#">Topic</a></li>
<li class="topics"><a href="#">Topic</a></li>
</ul>
On clicking a <li>
within my <ul>
, I aim to load a specific <div>
from another HTML file onto my webpage.
Sample Content of the <div>
:
<div id="topicDiv">
<div class="col-sm-8 col-sm-offset-1 col-xs-12 col-xs-offset-0 col-md-8 col-md-offset-1 col-lg-8 col-lg-offset-0">
<h6 class="courseOptions">Topic Title</h6>
<br>
<input type="text" style="width: 380px min-width: 20px" class="form-control" name="text" id="editorText">
<br>
</div>
</div>