not selector, on() click event
<p>I am having some problems in executing the following code:</p>

<pre><code>    var i = 1;  
$('.hello:not(.selected)').on('click',function(){
    $(this).addClass('selected');       
    console.log(i++);   
});
</code></pre>

<p>The problem is that this code should trigger just ONE time after the class selected has added, but it is executing many times, I just want the <em>i</em> variable not to increase. In other words, I am trying to do the following (which works, but i don't want to use the live function since it has deprecated):</p>

<pre><code>$('.hello:not(.selected)').live('click', function () { 
   $('.hello').removeClass('selected');
   $(this).addClass('selected');
... 
});
</code></pre>

<p>Thanks so much for your responses in advance,
k</p>
