You can do this as simple as this:
$(function(){ // you can wrap it here with in document ready block
var i = 0;
$("p").click(function(){
$(this).html(i++);
});
});
or may be a better one:
$(function(){ // you can wrap it here with in document ready block
$("p").click(function(){
$(this).html(+this.textContent + 1);
});
});