0
I am making use of toggle to change an icone and noticed that the script I made did not work at all, I played it inside html and it worked smoothly, but when I play it back to his js file, where it has several functions that I am using, It just doesn’t 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 checked the order of loading of Jquery, I have checked if the path is correct, I do not know what else
You are probably referenced to Jquery after your.Js File
– Marconi
Does the file reference you are using is not wrong? In the browser console shows some error message?
– Pedro Camara Junior
already looked at it, the jquery is referenced even before, and I also looked if the reference would be wrong, but is pulling normal, the Inspect shows right without any request error
– Victor Siqueira
Importing the script you created is in the html <head> section?
– Moykn
no, I’m leaving it to the end of html before closing the body, so it doesn’t compete with loading css and html,
– Victor Siqueira
How you load that file
.js
external? do it at the end of the body?– Sergio
Try using a.log('before') console and.log('inside') click ;
– Luizz
outside he catches, inside no
– Victor Siqueira