I'm attempting to make a p tag appear and disappear when I click on the h1 I feel I have a good understanding of the process in JavaScript (obviously I don't but I cant seem to get it to do anything at all (I'm really new to this, like only a couple weeks into JS) here is the Code
<script type="text/javascript">
function hideAway() {
var pText = document.getElementsByClassName('imgpar');
if (pText.style.display === 'none') {
pText.style.display = 'block';
}else if (pText.style.display === 'block') {
pText.style.display = 'none';
}
}
</script>
<div class="left-image">
<h1 onClick= hideAway()>header</h1>
<img title="skater name" src="skater.jpeg" alt="skater">
<p class= 'imgpar'>skateboard bio
</p>
</div>