title: How to pass parameter in onclick in jquery
body: <p>The code below is calling In index.html </p>
  
  <pre><code>    &lt;script src="js/jquery/jquery-1.8.2.min.js"&gt;&lt;/script&gt;
      &lt;script src="js/px.js" type="text/javascript" &gt;&lt;/script&gt;
      &lt;script type="text/javascript"&gt;
          var newGame = new px1("black");
          new px1Generator(newGame);
      &lt;/script&gt;
  </code></pre>
  
  <p>the code below is in px.js</p>
  
  <pre><code>var px1 = function (color) {
     if (color == "white") {
          this.x = "100";
     } else if (color == "black") {
          this.x = "900";
     }};
  var px1Generator= function (px1obj) {
      for (i = 0; i &lt; 10; i++) {
          $("#mainGame").append("&lt;div class='pawn white'&gt;&lt;/div&gt;");
      }
      //for 10 object upon add onClickEvent
      $(".pawn.white").on("click", function (event, px1obj) {
         alert(px1obj.x)
      });
  };
  </code></pre>
  
  <p>I want to send 100 or 900 to onclick function, how to do it ?
  The error accord when user clicks on divs</p>