I'm looking for a link similar to url(img/bg/06.jpg)
, but when using jQuery, I get a longer link like
url("file:///D:/WORKING%20FILE/One%20Landing%20Page/version/img/bg/06.jpg")
https://i.stack.imgur.com/8WKgv.png
Below is the code snippet in question:
<div class="box_bg">
<div style="background-image: url(img/bg/06.jpg)" class="single_bg"></div>
<div style="background-image: url(img/bg/07.jpg)" class="single_bg"></div
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js">
<script>
$('.box_bg .single_bg').each(function () {
var bg_img = $(this).css('backgroundImage');
$(this).click(function() {
window.alert(bg_img);
});
});
</script>