[Fixed]-Jquery :not selector doesn't work with style on class 14 December 2023 by thecoderscamp.com 1👍 ✅ You should watch out what your templating system is doing with your JavaScript code. IMHO this could work better: $(".products:not(#p" + {{ currentpagen }} + ")").css("display", "none"); The result should be this: 👤gus27 Build an includable template as string [django] Source:stackexchange.com