I want to load .js file before the </body>
in footer only if div with particular class name exists on page. I found the div with class name using if condition. But I am not getting how to add script in footer of page with it.
Here is my if condition code
if ($("#world-map-markers")[0]){
} else {
// Do something if class does not exist
}
I want to add this in static html page. There is no backend language.
Thanks