Jquery - why is click() and .on("click") triggering twice
<p>Why is this getting triggered twice on click? It isn't calling any external functions. The result is that the offState gets triggered twice, negating its purpose. Does click() fire twice by default? I also tried <code>.on('click', function()...</code> with the same results.</p>

<pre><code>function makeBackNav(){
    $('.backTitle').text("");
        //make back button's text the previously selected category
        $('.backTitle').append(prevLocation).click(function(){
            //need to swap images around so that they are activated on click
                var onState = $('#' + selectedCategory).find('img').first().attr('src');
                var offState = $('#' + selectedCategory).find('img').last().attr('src');
            $('#' + selectedCategory).find('img').last().attr('src', onState);
            console.log(offState);          
        });
}
</code></pre>
