I'm trying to get the background-image: url('XXX');
this is how I'm getting all the inline css
Can somebody help me to get only the url of the background-image. Thanks
$('.c-image').click(function() {
var x = $('.colored').attr('style');
console.log(x)
})
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<div class="c-image">
<span class="c-background">Outer Span
<span class="colored" style= "background-size: 100%; background-repeat: no-repeat; background-image: url('0963870.jpg'); ">Inner Span</span>
</span>
</div>