I have html file with a few js files and jquery.
Scripts from file 1.js work fine. Scripts from file 2.js also work fine but Jquery don't works always. So I run some script and on result it should hide ".popup". Everything works – I run a message to console but events like hide() or click() don't work.
console.log("All done!");//works
console.log($(".popup"));//works fine – shows the right element in console
$(".popup").click();//doesn't work
$(".popup").hide();//doesn't work
I don't want to connect all scripts into one file and try to understand why there is always fine with scripts from one file and nothing works with another.
Any ideas?