I have a style on my web page that uses the body::before to set an image. I want to change this image with jQuery after the page loads. I've tried doing something like this but with no success.
$('body::before').css('background-image','image.jpg')
Here is my simple html:
<html lang="en">
<head>
<meta charset="UTF-8" />
<script src="lib/jquery.min.js" type="application/javascript"></script>
<title>x</title>
<style>
body::before {
content: "";
background-image: url("http://peterkellner.net/wp/wp/wp-content/uploads/2018/05/cropped-peterkellnernet-300x60.png");
background-size: contain;
background-repeat: no-repeat;
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
z-index: 9999;
display: inline;
}
</style>
</head>
<body>
<script src="_test.js" type="application/javascript"></script>
</body>
</html>