title: Getting background image url from inline css with jquery
body: <p>I need same link as <code>url(img/bg/06.jpg)</code> but jquery give me a long link same as <code>url("file:///D:/WORKING%20FILE/One%20Landing%20Page/version/img/bg/06.jpg")</code> </p>
  
  <p><a href="https://i.stack.imgur.com/8WKgv.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/8WKgv.png" alt="enter image description here"></a></p>
  
  <p>Here is my code: </p>
  
  <pre><code>&lt;div class="box_bg"&gt;
      &lt;div style="background-image: url(img/bg/06.jpg)" class="single_bg"&gt;&lt;/div&gt;
      &lt;div style="background-image: url(img/bg/07.jpg)" class="single_bg"&gt;&lt;/div
  &lt;/div&gt;
  
  
  &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"&gt;
  
  &lt;script&gt;
      $('.box_bg .single_bg').each(function () {
          var bg_img = $(this).css('backgroundImage');
          $(this).click(function() {
              window.alert(bg_img);
          });
      });
  &lt;/script&gt;
  </code></pre>