title: How to set background-image in body::before with jQuery
body: <p>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.</p>
  
  <pre><code>$('body::before').css('background-image','image.jpg')
  </code></pre>
  
  <p>Here is my simple html:</p>
  
  <pre><code>&lt;html lang="en"&gt;
    &lt;head&gt;
      &lt;meta charset="UTF-8" /&gt;
      &lt;script src="lib/jquery.min.js" type="application/javascript"&gt;&lt;/script&gt;
      &lt;title&gt;x&lt;/title&gt;
      &lt;style&gt;
        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;
        }
      &lt;/style&gt;
    &lt;/head&gt;
    &lt;body&gt;
      &lt;script src="_test.js" type="application/javascript"&gt;&lt;/script&gt;
    &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>