Jquery .on('click') strange behavior - selects all elements with same class name
<p>Im trying to add the text contained inside an <code>&lt;li&gt;</code> element when the user clicks on it to an input field <code>#private_users</code>. The problem is that if the list looks like this: </p>

<pre><code>&lt;ul&gt;
&lt;li class="user_li_selection"&gt;Jane&lt;/li&gt;
&lt;li class="user_li_selection"&gt;John&lt;/li&gt;
&lt;ul&gt;
</code></pre>

<p>And then the user clicks on 'John', the string that gets puts into the input box looks like <code>John, Jane, John</code>. Then, after this first selection, the script behaves normally attaching only the selected names. Basically, it seems like the script is attaching the text contained in all of the li elements and then attaching the text of the one selected. I cant't figure why this is happening. It may be useful to note, that the <code>&lt;li&gt;</code> elements are being attached dynamically with a different script. </p>

<pre><code>$(document).on('click', '.user_li_selection', function(e) {
             e.preventDefault; 
             var selection = $(this).html();
             var current_string = $('#private_users').val();

             arr = current_string.split(','), i;
             length =  arr.length;

             if (length != 1) {
             arr[length-1] = ' '+selection+', ';
             } else {
             arr[length-1] =  selection+', ';
             }

             $('#private_users').val(arr);

             //$('.input_auto_complete').remove();

          });



     $('#private_users').keyup(function() {

        var input = $(this).val();

        arr = input.split(', '), i; 
        length =  arr.length;
        var current_input = arr[length-1];

        var input_box = $('#private_users');
        var position = input_box.position();

        if ($('.input_auto_complete').length == 0 &amp;&amp; input !== '') {
            $('body').append('&lt;div class="input_auto_complete"&gt;&lt;/div&gt;');
        }

        if (input == '') {
            $('.input_auto_complete').remove();
        }

        $('.input_auto_complete').css('top',position.top + 24);
        $('.input_auto_complete').css('left',position.left);
        $('.input_auto_complete').show();

        $.post('/username-query', {
        'user_input': current_input
        }, function(data) {
        $('.input_auto_complete').empty().append(data);
        }); 

     });

     $('#private_users').blur(function () {

        if ( !$('.user_li_selection').click() ) {
         $('.input_auto_complete').remove();
        }

     });
</code></pre>

<p>The input field I am targeting is just a simple text input like this: </p>

<pre><code>&lt;input type="text" id="private_users" /&gt;
</code></pre>

<p><a href="http://jsfiddle.net/JtGdv/1/" rel="nofollow"><strong>JS FIDDLE EXAMPLE:</strong></a> (MAKE SURE to SELECT THE INPUT FIELD before selecting an item from the list or the problem will not occur.)</p>
