Answer the question
In order to leave comments, you need to log in
How to choose access to the desired element?
Click on the image to open the window.
<div class="youtube-player" data-id="bHQqvYy5KYo" playoption="autoplay">
<div>
<img id="playVideo" class="youtube-thumb" src="//i.ytimg.com/vi/bHQqvYy5KYo/hqdefault.jpg">
<div class="play-button"></div>
</div>
</div>
<div class="youtube-player" data-id="bHQqvYy5KYo" playOption="autoplay"></div>
$('#myModal').on('shown.bs.modal', function () {
document.getElementsByID("playVideo").click();
});
Answer the question
In order to leave comments, you need to log in
$(".youtube-player #playVideo").click();
In general, it’s not good that you have the same id for elements.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question