JSFiddle - React, Tailwind, and code Playground

HTML

<div id="container">
    <a href="#">This is the link</a>

    <br /><br />
    <br /><br />

    <div id="player"></div>
</div>


 <script>
        var tag = document.createElement('script');
        tag.src = "http://www.youtube.com/player_api";
        var firstScriptTag = document.getElementsByTagName('script')[0];
        firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);

        // 3. This function creates an <iframe> (and YouTube player)
        //    after the API code downloads.
        var player;
        function onYouTubePlayerAPIReady() {
            player = new YT.Player('player', {
            height: '390',
            width: '640',
            videoId: 'iqeUskxcqhw'
            });
        }

        function onPlayerReady(event) {
            event.target.playVideo();
        }

        $(document).ready(function() {
            $('a').click(function(e) {
                player.stopVideo();
                e.preventDefault();
            });
        });
 </script>