I am trying to get the contents of a class that is inside my attached stylesheet
filename: style.css
.my-class{
background-image: url("img/build_animation_menu_no_loop_2.png");
background-repeat: no-repeat;
pointer-events: none;
background-size: contain;
}
it is attached to the following div:
<div id="myclass" class="my-class">some text</div>
I would like to extract the url from the background-image to a JS variable, as such
let url = "img/build_animation_menu_no_loop_2.png"
How can I do that in pure javascript (no Jquery)?