Call JS function in php array
<p>I already loaded the .js file with "myFunction" but i don't know how to call the js function inside the php code. When i view the source it just shows onclick="". How can i fix this?</p>

<pre><code>    &lt;?php
        wp_nav_menu( array(
        'theme_location' =&gt; 'primary' ,
        'items_wrap' =&gt; 
            '&lt;ul class="topnav"&gt;
                &lt;li class="home" id="home"&gt;
                    &lt;a href="' . get_home_url() . '"&gt;Startseite&lt;/a&gt;
                &lt;/li&gt;
                %3$s
                &lt;li class="icon"&gt;
                    &lt;a href="javascript:void(0);" onclick="myFunction()"&gt;&amp;#9776;&lt;/a&gt;
                &lt;/li&gt;
            &lt;/ul&gt;'
        ));
    ?&gt;
</code></pre>