how would I removeClass after a certain div is loaded on a page?
-
15-11-2019 - |
Question
I'm wondering how I can remove a certain class after a specific div is loaded on a page. Does anyone know the appropriate way to do this using jquery?
I'm using a special class for loading and would like it removed on the div once the div has loaded.
Solution
Since you are not using AJAX, simply use removeClass
and put the code in $(document).ready
so that it won't execute until the dom is loaded.
$(document).ready(function(){
$("#myElement").removeClass("someClass");
});
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow