
10-02-2007
|
| Senior Member
Join Date: Jun 2007
Posts: 1,413
BRL$: 4,235.66 Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 172 | | Simple DOM function fails in IE I've just started learning W3C DOM and I wrote my first script yesterday that to my happiness worked in Firefox 2.0.0.7 but not in IE 6.0. The idea for the script is to use a select dropdown list to decide the width of a square. This is the code in the head:code: function changeWidth(){ var selObj = document.getElementById("selectWidth"); var selWidth = selObj.options[selObj.selectedIndex].value; var square = document.getElementById("testSquare"); square.style.width = selWidth; } And this is the code for the body: code: 200 195 190 185
In this box there is a lot, and I do mean a lot, of text that shall change as the width of the box changes.
Can I get this to work in version 5+ browsers by changing my code? The problem is probably in the changeWidth() method Thanks in advance! To view links or images in this forum your post count must be 1 or greater. You currently have 0 posts. | |
__________________ To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts.
To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts. | | | |