itivae
04-09-2014, 12:46 AM
So I am tweaking a script that takes an onClick and shows a hidden div. These were originally accomplished through mouseenter. I was hoping to just use a style change to hide the parent element once it is clicked.
i.e.
<div id="wrapper>
<div class="circle assessment">
<h2>Assess And Plan</h2>
<div class="circle_big">
<h2>Assess And Plan</h2>
<ul>
<li>Lorem ipsum dolor sit amet.</li>
<li>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin. </li>
<li>Lorem ipsum dolor sit amet, consectetur adipiscing.</li>
</ul>
<a onclick="this.parentNode.style.display = 'none';">Click Me</a>
</div>
</div>
I want to make the circle_big class disappear on the click of the href. Not quite sure what i am doing wrong . If I reference the parent of the parent everything disappears. With this usage I keep getting an
Uncaught TypeError: Cannot read property 'style' of undefined
Any help is appreciated.
Thanks in advance.
i.e.
<div id="wrapper>
<div class="circle assessment">
<h2>Assess And Plan</h2>
<div class="circle_big">
<h2>Assess And Plan</h2>
<ul>
<li>Lorem ipsum dolor sit amet.</li>
<li>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin. </li>
<li>Lorem ipsum dolor sit amet, consectetur adipiscing.</li>
</ul>
<a onclick="this.parentNode.style.display = 'none';">Click Me</a>
</div>
</div>
I want to make the circle_big class disappear on the click of the href. Not quite sure what i am doing wrong . If I reference the parent of the parent everything disappears. With this usage I keep getting an
Uncaught TypeError: Cannot read property 'style' of undefined
Any help is appreciated.
Thanks in advance.