D
Dave
Hi
How do I, via javascript, get an elements style value as it is in
the .css file, and not the computed value.
For #span, in the code below, I would like to get the value 167% and
not 22px.
So are there an direct way to get that value just as you would when
using, window.getComputedStyle(element, pseudoElt) or element.style.
Thanks / Dave
test.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Test</title>
<link rel="stylesheet" type="text/css" href="test.css" />
</head>
<body>
<p id="p">Lalala lalala <span id="span">hmm</span> lalala lalala</
p>
</body>
</html>
test.css
body{font-size:13px;}
#p{font-size:100%;}
#span{font-size:167%;color:green;}
How do I, via javascript, get an elements style value as it is in
the .css file, and not the computed value.
For #span, in the code below, I would like to get the value 167% and
not 22px.
So are there an direct way to get that value just as you would when
using, window.getComputedStyle(element, pseudoElt) or element.style.
Thanks / Dave
test.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Test</title>
<link rel="stylesheet" type="text/css" href="test.css" />
</head>
<body>
<p id="p">Lalala lalala <span id="span">hmm</span> lalala lalala</
p>
</body>
</html>
test.css
body{font-size:13px;}
#p{font-size:100%;}
#span{font-size:167%;color:green;}