Why doesn't my PHP-generated javascript work?
<p>i have the following javascript code</p>

<pre><code>echo ' &lt;a href = "javascript:void(0)" onclick = "document.getElementById("items").style.display="block";document.getElementById("fade").style.display="block""&gt;&lt;span style="padding-left:0px"&gt;&lt;input type="submit" name="r" style="width: 138px; font-weight:bold;  " value="Add item"/&gt;&lt;/span&gt;&lt;/a&gt;
';
</code></pre>

<p>i am trying to execute the script from within a php script. when i click on the button to execute the java part of it, nothing happens. i then try it this way</p>

<pre><code>echo ' &lt;a href = "javascript:void(0)" onclick = "document.getElementById('items').style.display='block';document.getElementById('fade').style.display='block'"&gt;&lt;span style="padding-left:0px"&gt;&lt;input type="submit" name="r" style="width: 138px; font-weight:bold;  " value="Add item"/&gt;&lt;/span&gt;&lt;/a&gt;
';
</code></pre>

<p>and got this parse error: parse error, expecting <code>'," or</code>';".</p>
