How can I get URL property value from element defined as
<html>
<head>
<style type="text/css">.sprite-thumb {background-image:url(example.jpg);}</style>
</head>
</html>
I tried $(data).find("header").css("sprite-thumb") but got undefined
data? Are you getting the html back from an ajax call?headerwon't be found as you don't have aheaderelement. You cannot read css properties like that..cssis used to get/set css properties off an element not read the defined properties in your stylesheets. You could grab all elements of classsprite-thumboff your html and read the background-image property with$('.sprite-thumb').css("background-image")but I think you need to define what your ultimate goal is.dataelement in the example above... so$(data)should give youReferenceError: data is not definedor something similar depending on browser...datain my code, which contains elements quoted in the question.