title: How do I add a php variable to a onclick function argument?
body: <p>Beginner JS here.</p>
  <p>I am trying to add a PHP variable to a Javascript onclick function. I converted the PHP variable to a JS variable just fine. However, when adding the JS variable to the function I'm not receiving the desired output.  What am I doing wrong?</p>
  <pre><code>&lt;script&gt;
    js_logo_number = &quot;&lt;?php echo $logo_number; ?&gt;&quot;;
  &lt;/script&gt;
  &lt;img src='&lt;?php echo $image1[0]; ?&gt;' onclick=&quot;openModal();currentSlide(js_logo_number)&quot;&gt;
  </code></pre>