title: Can't change background image in body using jQuery
body: <p>I'm trying to replace an image in body background using jQuery, but no matter what I do, it doesn't work. Code is almost the same as in other questions or tutorials. 
  Here's CSS which works:</p>
  
  <pre><code>body{
       background-image: url('img/1.jpg');
  }
  </code></pre>
  
  <p>But here's jQuery which doesn't: </p>
  
  <pre><code>$('body').css('background-image', 'url(img/2.jpg)');
  </code></pre>
  
  <p>and HTML:</p>
  
  <pre><code> &lt;html lang="pl"&gt;
   &lt;head&gt;
   &lt;script src="https://ajax.aspnetcdn.com/ajax/jQuery/jquery-3.3.1.min.js"&gt;
   &lt;/script&gt;
   &lt;script src="script.js"&gt;&lt;/script&gt;
   &lt;meta charset="UTF-8"&gt;
  
   &lt;link rel="stylesheet" href="styles.css"&gt;
   &lt;Title&gt; Moja firma &lt;/Title&gt;
   &lt;/head&gt;
   &lt;body&gt;
  
   &lt;/body&gt;
   &lt;/html&gt;
  </code></pre>
  
  <p>I checked, and jQuery is loaded as well as the file with its code.
  I also tried putting quotes in url, but also nothing.</p>