topical media & game development
#javascript-code-02-style.htm / htm
<html>
<head>
<style>p { height: 100px; }</style>
<script>
window.onload = function(){
// Locate the paragraph to check the height of
var p = document.getElementsByTagName(“p”)[0];
// Check the height the traditional way
alert( p.style.height + “ should be null” );
// Check the computed value of the height
alert( getStyle( p, “height” ) + “ should be 100px” );
};
</script>
</head>
<body>
<p>I should be 100 pixels tall.</p>
</body>
</html>
(C) Æliens
20/2/2008
You may not copy or print any of this material without explicit permission of the author or the publisher.
In case of other copyright issues, contact the author.