title: How to call an onClick Function when creating a span, In react
body: <p>I am working in react and when a button is clicked, a li item gets created, in the list item I have a span with a glyphicon, i want to create an onClick event for the glyphicon, but it doesn't work. </p>
  
  <p>Html </p>
  
  <pre><code>&lt;ul id="list"&gt;&lt;/ul&gt;
  </code></pre>
  
  <p>this is the method which creates the list item</p>
  
  <pre><code>var listItem = document.createElement("li");              
          listItem.innerHTML = this.tokenSeries;
          var span = document.createElement("span");
          span.innerHTML = "&lt;span class='glyphicon glyphicon-remove' onClick={this.test}&gt;&lt;/span&gt;" 
          listItem.appendChild(span);
          document.getElementById('list').appendChild(listItem);
  </code></pre>
  
  <p>this is my test method</p>
  
  <pre><code>@action.bound test() {
          alert("hello");
      }
  </code></pre>