Hi,
can somebody tell why i got back an empty string, when i want to access the color property of a html-Element like this:
[CODE]<?xml version=”1.0″ encoding=”iso-8859-1″ ?>
<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Strict//EN”
“http://www.w3.org/chtml1/DTD/xhtml1-strict.dtd”>
<html xmlns=”http://www.w3.org/1999/xhtml”>
<head>
<title>Test</title>
<meta http-equiv=”content-type” content=”text/html; iso-8859-1″/>
<style type=”text/css”>
/*<![Cdata[ */
p {
color: green;
}
/*]]> */
</style>
<script type=”text/javascript”>
/* <! [Cdata[ */
window.onload = function() {
BUG.DOMLoaded = true;
BUG.feed(‘calling window.onload’,2);
BUG.feed(‘Color: ‘+typeof document.getElementById(‘test’).style.color,2);
BUG.feed(‘Color: ‘+document.getElementById(‘test’).style.color,2);
}
/* ]]> */
</script>
</head>
<body>
<h1>Test</h1>
<p id=”test”>text</p>
</body>
</html>
The typeof tells me the type of the property is string, but if i print it out its empty, why?