title: onclick load function in php
body: <p>I m have 2 my code and one work and when i use code 2 not work.</p>
  
  <p>Javascript is still the same. 
  This is javascript and work</p>
  
  <pre><code>function addto(selid)
  {
      var i;
      var item = "";
  
      for (i = 0; i &lt; 1000; i++) { 
          item = "incart_"+i; 
          if(getCookie(item) == "")
              {  
              setCookie(item,selid,24);  
                  break;
              }
      }
  </code></pre>
  
  <p>}</p>
  
  <p>This code work
  <div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>    &lt;button onclick='addto("1");' data-toggle="tooltip" title="Add"&gt;&lt;i class="fa fa-shopping-cart shop-card-icon"&gt; &lt;/i&gt;&lt;/button &gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>but when i use php  does not respond</p>
  
  <p>// If i use the action in php it goes.</p>
  
  <pre><code>&lt;button  &lt;?php echo "onclick='addto('".$row["id"]. "');'"; ?&gt;  data-toggle="tooltip" title="Add"&gt;&lt;i class="fa fa-shopping-cart shop-card-icon"&gt; &lt;/i&gt;&lt;/button&gt;
  </code></pre>