I've been trying out David Betz's sample chapter on doing graphics with
javascript
http://www.davidbetz.net/graphics/
But I can't get the horizontal line to draw. There's no errors in
Firefox's javascript console so I'm not sure what I'm doing wrong. I'm
not even close to javascript expert, though...
<html>
<head>
<title>Horizontal Line Test</title>
<script language="javascript" type="text/javascript">
function DrawHorizontalLine(x, y, l, c, parentObj) {
var longPixel = document.createElement('div');
longPixel.className = 'Ink';
longPixel.style.width = 1 + 'px';
longPixel.style.left = x + 'px';
longPixel.style.top = y + 'px';
longPixel.style.borderTopColor = c;
parentObj.appendChild(longPixel);
}
</script>
</head>
<body>
<div id="dynamicAttacher"></div>
<script language="javascript" type="text/javascript">
var dynamicAttacherObj = document.getElementById('dynamicAttacher');
DrawHorizontalLine( 100, 100, 200, "#000000, dynamicAttacherObj );
</script>
</body>
</html>