MaterializeCss modal Error openModal is not a function
<p>I have all requirements Jquery, Materialize.js sitting above my Js file however I get the warning openModal is not a function..I checked the modal name is right and I can run Materialize.toast so I know Materialize.js is working. Triggering with the button does not call the modal either. Here is the code..</p>

<p>Scripts:</p>

<pre><code>&lt;script type="text/javascript" src="https://code.jquery.com/jquery-2.1.1.min.js"&gt;&lt;/script&gt;
&lt;script type="text/javascript" src="/js/materialize.js"&gt;&lt;/script&gt;
&lt;script type="text/javascript" src="/js/video.js"&gt;&lt;/script&gt;
&lt;script src="/js/admin.js"&gt;&lt;/script&gt;
</code></pre>

<p>Trigger:</p>

<pre><code>&lt;button data-target="modal1" class="btn modal-trigger"&gt;Modal&lt;/button&gt;
</code></pre>

<p>Modal:</p>

<pre><code>    &lt;!-- Modal Structure --&gt;
    &lt;div id="modal1" class="modal"&gt;
        &lt;div class="modal-content"&gt;
            &lt;h4&gt;Modal Header&lt;/h4&gt;
            &lt;p&gt;A bunch of text&lt;/p&gt;
        &lt;/div&gt;
        &lt;div class="modal-footer"&gt;
            &lt;a href="#!" class=" modal-action modal-close waves-effect waves-green btn-flat"&gt;Agree&lt;/a&gt;
        &lt;/div&gt;
    &lt;/div&gt;
&lt;/div&gt;
</code></pre>

<p>js:</p>

<pre><code> var modal = document.getElementById('modal1');
  modal.openModal();
$('#modal1').leanModal();
$('#modal1').openModal();
</code></pre>