CSS or JQuerry not working inside javascript : I am working on a website where in header I try to inspire people with a text that is constantly changing with javascript. One of the lines that appear among this text includes a link to the video, which was supposed to be a modal video, but it somehow fails to load properly while other videos outside this of this javascript work just fine. [Here][1] is the video of the problem. 

I am not sure, what isn't working here. Is it CSS or JQuerry? Here is the HTML code: 

    <!doctype HTML> 
    <html lang="en-US"> 
    <head>
        <!-- load latest jQuery 3.1.1 -->
        <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
    
        <!--VIDEO-CSS-->
        <link href="./css/modal-videos.css" rel="stylesheet">
        
        <!--HTML-CSS-->
        <link rel="stylesheet" href="./css/style.css">
        
        <!--VIDEO-scripts-->
        <script src="./js/modal-videos-a.js"></script>
        <script src="./js/modal-videos-b.js"></script>
        <script src="./js/modal-videos-c.js"></script>
    </head> 
    
    <body class="no-touch"> 
    
        <div id="moto"></div>
       <!--THIS SCRIPT IS THE PROBLEM-->
        <script type="text/javascript" src="./js/headline.js"></script>
    
        <div class="boxspace">
            <div class="box">
                <div class="boxInner">
                    <div class="titleBox">
                        <header>
                        Header title
                        </header>
                        <a href="./video/test.mp4">video</a>
                        </p>
                    </div>
                </div>
            </div>
        </div>
       
    </body> 
    </html> 

Then here is the javascript `./js/headline.js` which is bugging me, because `<a href="./video/test.mp4">video</a>` isn't formated as instructed in `./css/modal-videos.css` although it references same local video file in a same way as in HTML file: 

    var text = ["Line 1",'Line 2 and nonworking <a href="./video/test.mp4">video</a>.'];
    var counter = 0;
    var elem = document.getElementById("moto");
    ChangeFunction();
    setInterval(ChangeFunction, 3000);
    
    function ChangeFunction() {
        var moto = text[counter++];
        $(elem).fadeOut('slow', function() {
          $(elem).html(moto);
          $(elem).fadeIn('slow');
        });
    
        if(counter >= text.length) { counter = 0; }
    }

Here are also two CSS files - first `./css/modal-videos.css` (I just borrowed this one and I don't understand it very well) and second `./css/style.css`:

    .modal.fade.in {
        top: 20%;
    }
    .fade.in {
        opacity: 1;
    }
    .modal.fade {
        -webkit-transition: opacity .3s linear, top .3s ease-out;
        -moz-transition: opacity .3s linear, top .3s ease-out;
        -o-transition: opacity .3s linear, top .3s ease-out;
        transition: opacity .3s linear, top .3s ease-out;
        top: -25%;
    }
    .fade {
        opacity: 0;
        -webkit-transition: opacity 0.15s linear;
        -moz-transition: opacity 0.15s linear;
        -o-transition: opacity 0.15s linear;
        transition: opacity 0.15s linear;
    }
    .hide {
        display: none;
    }
    .modal {
        position: fixed;
        top: 10%;
        left: 50%;
        z-index: 1050;
        width: 560px;
        margin-left: -280px;
        background-color: #ffffff;
        border: 1px solid #999;
        border: 1px solid rgba(0, 0, 0, 0.3);
        -webkit-border-radius: 6px;
        -moz-border-radius: 6px;
        border-radius: 6px;
        -webkit-box-shadow: 0 3px 7px rgba(0, 0, 0, 0.3);
        -moz-box-shadow: 0 3px 7px rgba(0, 0, 0, 0.3);
        box-shadow: 0 3px 7px rgba(0, 0, 0, 0.3);
        -webkit-background-clip: padding-box;
        -moz-background-clip: padding-box;
        background-clip: padding-box;
        outline: none;
        margin-top: 10px;
        margin-bottom: 10px;
        overflow-y: hidden;
    }
    .modal-header {
        padding: 9px 15px;
        border-bottom: 1px solid #eee;
    }
    .modal-header .close {
        margin-top: 2px;
    }
    .close {
        float: right;
        font-weight: bold;
        line-height: 20px;
        color: #000000;
        text-shadow: 0 1px 0 #ffffff;
        opacity: 0.2;
        filter: alpha(opacity=20);
        font-size: 45px;
        height: 50px;
        cursor: pointer;
    }
    .modal-body {
        position: relative;
        max-height: 80%;
        overflow-y: visible;
        padding: 5px;
        margin-bottom: -4px;
    }
    
    .modal-body.modal-body-video iframe {
        height: 400px;
        width: 100%;
    }
    
    .modal-backdrop,
    .modal-backdrop.fade.in {
        opacity: 0.8;
        filter: alpha(opacity=80);
    }
    .modal-backdrop {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        left: 0;
        z-index: 1040;
        background-color: #000000;
    }
    .modal-header .link {
        white-space: normal;
        margin-left: 5px;
    }
    @media (max-width: 767px) {
        .modal.fade.in {
            top: 20px;
        }
        .modal {
            position: fixed;
            top: 20px;
            left: 20px;
            right: 20px;
            width: auto;
            margin: 0;
        }
    }
    @media (max-width: 480px) {
        .modal {
            top: 10px;
            left: 10px;
            right: 10px;
        }
    }

and

    body{
        margin: 0;
        padding-left: 10%;
        padding-right: 10%;
        padding-top: 2%;
        padding-bottom: 1%;
    }
    #moto{
        margin-top: -20px;
        font-size: 1.7vw;
        text-align: center;
        height: 5vw;
        opacity: 0.8;
    }
    .boxspace {
        overflow: hidden;
    }
    .box {
        float: left;
        position: relative;
        width: 16.6666%;
        padding-bottom: 16.6666%;
    }
    .boxInner {
        position: absolute;
        left: 2%;
        right: 2%;
        top: 2%;
        bottom: 2%;
        overflow: hidden;
        border: thin solid #969696;
        border-radius: 4%;
    }
    .boxInner .titleBox {
        position: absolute;
        /*no top border*/
        bottom: 0;
        left: 0;
        right: 0;
        /*we push the square down*/
        margin-bottom: -20%;
        background: #000000;
        background: rgba(0, 0, 0, 0.8);
        color: #FFFFFF;
        padding-top: 2%;
        padding-bottom: 2%;
        padding-left: 2%;
        padding-right: 2%;
        text-align: center;
        font-size: 1.2vw;
        -webkit-transition: all 0.3s ease-out;
        -moz-transition: all 0.3s ease-out;
        -o-transition: all 0.3s ease-out;
        transition: all 0.3s ease-out;
    }
    .boxInner .titleBox header{
        color: #FFFFFF;
        font-size: 1.4vw;
     }
    .boxInner .titleBox p{
        color: #FFFFFF;
        font-size: 1.0vw;
     }
    body.no-touch .boxInner:hover .titleBox, body.touch .boxInner.touchFocus .titleBox {
        margin-bottom: 0px;
    }

Has anyone got any suggestions on how to fix the video included in javascript to be rendered same as the other one?
  


  [1]: https://www.dropbox.com/s/dhewkwi83dddga8/output.mkv?dl=0
