here's my html code :
<section>
<div class="article">
<p>
things aren't thing anymore they basically copy of originally thing created bu someone no one know as now we can calll them copy's
</p>
</div>
</section>
<br>
<section>
<div class="article">
<p>
things aren't thing anymore they basically copy of originally thing created bu someone no one know as now we can calll them copy's
</p>
</div>
</section>
<br>
<section>
<div class="article">
<p>
things aren't thing anymore they basically copy of originally thing created bu someone no one know as now we can calll them copy's
</p>
</div>
</section>
that my jquery code :
$(document).ready(function(){
$(".article").append('<span class="close" style="top:0px;background:#000;color:#fff;padding:10px;cursor:pointer;">X</span>');
$(".close").click(function(){
$(this).parents(".article > p").hide();
});
});
I want to hide <p> when the user click on span , how can i have access to <p> only by jquery instead of typing <span>X</span> 3 times in html ?