Seperating JQuery Scripts with Selectors in External file does not work?
<p>I have a JQuery Selector and an event associates with it.I want to keep it in external file and just copy and directly save it. The thing which I see is that the external JavaScript that has the selector does not work. Can someone explain Why?</p>

<p>NOTE: I am able to use the same function within my HTML file but when externalize it. It just doesn't work .
The script that I have is as follows:-</p>

<pre><code> $('#pervious').click(function() {
        var presentSlide = $('.visible').attr('id');
        var tempArr = presentSlide.split("-");
        var persentSlideNo = tempArr[1];
        var perviousSlideNo = Number(persentSlideNo) - 1; if (perviousSlideNo &gt; -1) 
        {
        var perviousSlide = "Slide-" + perviousSlideNo;

            $('#' + presentSlide).fadeOut('slow',function(){
            $(this).removeClass('visible').addClass('hidden');
            });
            $('#' + perviousSlide).fadeIn('slow',function(){
            $(this).removeClass('hidden').addClass('visible');
            });
        }

    });
</code></pre>
