Why does a script work inside HTML rather than JS?

0

I'm using toggle to change an icon and I noticed that the script I made did not work at all, I threw it inside the html and it worked quietly, but when I play it back to its js file, where it has several functions that I'm using it, it just does not work anymore. the script is this:

$("span#orderColumn").click(function(){
    $("span i.i").toggleClass('halflings-triangle-top halflings-triangle-bottom');
});

It is very simple, but it is not working, I have already checked the load order of Jquery, I have already checked the path is correct, I do not know what it can be

    
asked by anonymous 28.10.2015 / 13:36

1 answer

1

Remember to put your .js file after jquery.

Place this code also inside

$(document).ready(function(){

})
    
28.10.2015 / 18:20