How to add a button to play YouTube video full screen using JavaScript?
问题 I'm coding a Google Chrome extension where I embed a YouTube video: <iframe id="ytplayer" type="text/html" width="640" height="360" src="https://www.youtube.com/embed/M7lc1UVf-VE" frameborder="0" allowfullscreen> I then added a button below that should allow a user to click to play this video in full screen: <a href="#" id="lnkFullScreen">Play full screen</a> The work is done via JavaScript (and jQuery) using the code I found here: $("#lnkFullScreen").click(function(e) { e.stopPropagation();