I'm relatively new to JQuery/Javascript scripting and I'm having some difficulty. How can I display one item with the same class without affecting the other items?
Here is my code:
$(function() {
$('.embedContainer > .myPosterImage').on('click', function() {
$('.embedContainer > .myPosterImage').hide();
$('.embedContainer > embed').show();
});
});
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<div class="embedContainer">
<img class="myPosterImage" src="img/websites/01_documentation.jpg" data-original="img/websites/full/01_full.jpg" />
<embed src="img/websites/Concept.pdf" width="563.41" height="375.98></embed>
</div>
<div class="embedContainer">
<img class="myPosterImage" src="img/websites/01_documentation.jpg" data-original="img/websites/full/01_full.jpg" />
<embed src="img/websites/Concept.pdf" width="563.41" height="375.98></embed>
</div>
Thank you very much.