Invalid or unexpected token html/php : <p>I am printing a php variable with html and the results are as follows:</p>

<pre><code>&lt;div class='chaty'&gt;
&lt;div class='chatDesc' id='9503e253936e716f18d9c57b4f97d618'&gt;
&lt;div class='tit'&gt;Creator: &lt;/div&gt;
&lt;div class='iriss'&gt;&lt;i id='close_chatn' 
onclick='closeChat(9503e253936e716f18d9c57b4f97d618)' class='material-
icons'&gt;close&lt;/i&gt;&lt;/div&gt;

&lt;form action='mypage.php' method='post'&gt;


&lt;div class='authr_name'&gt;&lt;button value='John Brown' name='userlink' 
class='subm_as_text'&gt;Hitsuji&lt;/button&gt;&lt;/div&gt;
&lt;/form&gt;
&lt;div class='titd'&gt;&lt;h3&gt;Description&lt;/h3&gt;&lt;/div&gt;
&lt;div class='description_chat'&gt;TThe Army of JOhn&lt;/div&gt;
&lt;/div&gt;


&lt;span onclick='openChat(9503e253936e716f18d9c57b4f97d618)'&gt;&amp;#9776;&lt;/span&gt;
&lt;div class='chatname'&gt;&lt;h3&gt;John Army&lt;/h3&gt;&lt;/div&gt;
&lt;div class='chatback'&gt;&lt;/div&gt;
&lt;div class='underlie'&gt;&lt;p&gt;Users: 1&lt;/p&gt;&lt;p&gt; Created: 2017/07/23 11:31:06am&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
</code></pre>

<p>I get an invalid or unexpected token in chrome and openChat() won't work. The error is on the line where
    <code>&lt;span onclick='openChat(9503e253936e716f18d9c57b4f97d618)'&gt;&amp;#9776;&lt;/span&gt;</code></p>
