Is there a way to extract the url
value from the inline style
of this particular div
?
<div
class="w-18 h-18 sm:w-20 sm:h-20 bg-gray-200 mx-auto bg-center bg-cover border border-gray-400 rounded-ch"
style="background-image: URL('https://d14u0p1qkech25.cloudfront.net/club_8702_65d827dd-03b9-4cce-8876-8bd33f306460_thumbnail_250x250')"
></div>
I managed to select the div
element using
document.querySelector('.rounded-ca')
However, when I accessed the .style
property on the div
, it returned an object
with only the following key:
{ "0": "background-image" }
Any suggestions on how I can retrieve the actual url
value that is associated with the background-image
property?