I'm using this code in my html page. when clicking on the image "photo_medias", the image disappears and the video iframe displays. It works fine, but I would like to make a jQuery function with this code. I don't want to have JavaScript inside my HTML. Can anybody help me with this?
<li class="mix videos">
<div onclick="this.nextSibling.style.display='block'; this.style.display='none'">
<img src="http://img.youtube.com/vi/<?php the_sub_field('youtube'); ?>/0.jpg" class="photo_medias" style="cursor:pointer" />
</div>
<div style="display:none">
<iframe class="youtube" src="//www.youtube.com/embed/<?php the_sub_field('youtube'); ?>" frameborder="0" allowfullscreen></iframe>
</div>
</li>