on() jquery not work with dynamic page?
<p>I want to use the jQuery <code>.on()</code> function with click.
Below is my code, currently it doesn't work, does this contain an error?  </p>

<pre><code>$('#header-left-container').prepend(
    results.rows.item(i).LibelleTypeTravail +
    "" +
    "&lt;br&gt;" +
    "&lt;img src='../js/images/add.png' id='img_go' class='upvote' name="+results.rows.item(i).IdTypeTravail+" &gt;" +
    "&lt;textarea rows='6'  cols='60' id='" +
    results.rows.item(i).IdTypeTravail +
    "'name='"+
    results.rows.item(i).LibelleTypeTravail +
    "'&gt; &lt;/textarea&gt;&lt;br&gt;&lt;br&gt;"
).trigger("create");

 $(".upvote").on("click", function() {
      window.localStorage.setItem("id_grp", id_grp_tr);
      window.localStorage.setItem("id_travail", e.target.name);
      $.mobile.changePage('../prestation_html/list_rubrique.html');
});
</code></pre>
