| Trusted Advisor with 7,024 posts. | | Join Date: May 2006 Location: S.F. Bay Area, CA Experience: Intermediate | |
Here is a test case that works in Firefox 3.6.8: Code: <html>
<head>
<title>JavaScript test</title>
<style type="text/css">
#targetElement {
border: 2px solid red;
width: 500px;
height: 200px;
margin: 0 auto 0 auto;
}
</style>
<script type="text/javascript">
function setWidth(element,width)
{
alert("Setting width of element '"+element+"' to: "+width);
}
</script>
</head>
<body onload="setWidth('targetElement',800);">
<p>This is a paragraph</p>
<div id="targetElement">
<p>This is the target text!</p>
</div>
</body>
</html> In your HTML, is 'MWD_body' a different element or something? Can you post a test case?
Peace... |