title: javascript: pass object to a javascript created from string
body: <p>Is this possible to pass an Object to a javascript when it is created from a string ?</p>
  
  <p>I tried this, but it don't look to work :</p>
  
  <pre><code>var myobject = {name:"auto",color:"blue"};
  
  var btn = "&lt;button type='button' onclick='myfunc(" + myobject + ");'&gt;Edit&lt;/button&gt;";
  </code></pre>
  
  <p>If I inspect the onclick event, the object look like : <code>[object Object]</code></p>