Hi, I'm having a problem utilizing the DOM. I tried using my own
code, but it wasn't working, so I tried to use code straight from
another web site and it verified that the problem may not be mine. I
am using IE 6.0.28 (sp5) on a Windows 2000 Server.
I am very new to DOM so I'm not ruling out that I'm doing something
wrong. However, I am posting the code that I got from another site
because I did notice that the examples were using Netscape. I'm
curious to know if there are differences between Netscape and IE for
DOM? Anyway the site that the code came from is
http://www-106.ibm.com/developerwork...jsdom/#figure2
and seems like it should work. I'm hoping somebody can help. Thank
you in advance.... Chris
<%@ Language=VBScri pt %>
<html>
<head>
<title>Gettin g Sticky</title>
<style type="text/css">
* {font-family: sans-serif}
a {font-size: 6pt}
.editButton {font-size:6pt}
</style>
<script type="text/javascript">
function getCurrentNumbe r() {
formElement = document.getEle mentById("noteF orm");
return formElement.chi ldNodes.item(1) .value;
}
function makeNewNote(){
mainDivElement = document.getEle mentById("mainD iv");
newNote = document.create Element("div");
newNote.setAttr ibute("id", "note"+getCurre ntNumber());
mainDivElement. appendChild(new Note);
noteForm.total. value= parseInt(noteFo rm.total.value) + 1;
}
</script>
</head>
<body>
<div id="mainDiv" style="height:8 5%; width:85%; border:3px solid
red;
padding: 10px; z-index:
-100" >
<h1>Getting Sticky</h1>
<form id="noteForm">
Current number of notes
<input type="text" name="total" value="0"size=" 3"/>
<input type="button" value="Add a new note"
onclick="makeNe wNote()" />
</form>
<div id="addhere"> </div>
</div>
</body>
</html>