I am looking for a way to extract the value from a CSS file using a JavaScript function.
Take a look at my code snippet below:
HTML file ->
<link rel="stylesheet" type="text/css" href="test_css.css" />
<script type="text/javascript">
function loadFunc(){
## need code here
## alert(left);
}
</script>
CSS file ->
.outer .inner
{
left: 30pt;
top: 20pt;
}
Note: I only require the specific property value from the CSS, not the entire text. Is there a predefined function that can help me achieve this?
For instance, I want to retrieve the value associated with the key "left" in the CSS file. The expected output should be "30pt".