The code will first set the variable i to 2. Then, when the user clicks the "trigger" element, the code will create a new "counter" element and will increment i within it.
$(function(){ // you can wrap it here with in document ready block
var i = 2;
$(".trigger").click(function(){
$("#counter").html("0" +i++);
});
});