Despite my best efforts, I can't seem to get the chosen div
to show and hide when the button is pressed.
<button id="showButton" type="button">Show More</button>
<div id="container">
<div id="fourthArticle">
<img class="row1pic" id="pic4" src="../Pictures/Gamerati/00-Shub-Niggurath-Rampage.jpg" alt="Freud everyone!">
<p>
<span style="font-weight:bold;">This is a third article</span>
this is the content of the article. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed
</p>
</div>
<div id="fifthArticle">
<img class="row1pic" id="pic5" src="../Pictures/Gamerati/00-Shub-Niggurath-Rampage.jpg" alt="Freud everyone!">
<p>
<span style="font-weight:bold;">This is a third article</span>
this is the content of the article. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed
</p>
</div>
<div id="sixthArticle">
<img class="row1pic" id="pic6" src="../Pictures/Gamerati/00-Shub-Niggurath-Rampage.jpg" alt="Freud everyone!">
<p>
<span style="font-weight:bold;">This is a third article</span>
this is the content of the article. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed
</p>
</div>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<script type="text/javascript">
$('#showButton').click(function () {
$('#container').toggleClass('hidden');
}
</script>
Regardless of my troubleshooting attempts, clicking the button does not trigger any changes. Even inserting an alert
in the .click
function did not work as expected. It seems like something is amiss here, but I'm at a loss as to where the issue lies.