title: Javascript- How to pass array as parameter at onclick event?
body: <p>I have an array that I want to pass to a javascript onclick function. I send that array in the onclick event of a button. The onclick function return me [object Object]. Is there a different way to do call that function with the array?</p>
  
  <p>Here My Code:</p>
  
  <pre><code>var data_type= $.parseJSON(data_playtype[1]);//{"1":"apple","2":"orange","23":"berry","8":"grape","9":"mango"}
  
  
  str1.push('&lt;td&gt;&lt;a href="javascript:void(0)" onClick="showABC(\''+data_type+'\')"&gt;'Data'&lt;/td&gt;');
  
  
  
  function showABC(fruit){
  
      $.each(fruit,function(pid,pt){
          alert(pt);
      });
  
  }
  </code></pre>