Hi everyone,

I am new to using dhtml techniques...
I have used some javascript before but not much...

I have the following code:

HTML Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
    "http://www.w3.org/TR/html4/strict.dtd">
<html>
	<head>
	<script type="text/javascript">
			
			ctr = 1;
			
			//Current medication management/addition of nodes
			function addCurMed()
			{
				//Create the necessary elements
				var newMedTr = document.createElement('tr');
				var newMedTd = document.createElement('td');
				
				//Create the medication element
				var newMed = document.createElement('input');
				newMed.type = "text";
				newMed.name = "m_" + ctr;
				newMed.maxlength = "255";
				
				
				//Append inputs to the <td>
				newMedTd.appendChild(newMed);
				
				//Append the td's to the tr
				newMedTr.appendChild(newMedTd);
				
				//Append the tr to the document
				document.getElementById('cMeds').appendChild(newMedTr);
				
				ctr++;
			}
		</script>
	</head>
<body>
	<table cellspacing="0" cellpadding="0" class="form" id="cMeds">
		<tr>
			<td>
				<input type="text" value="" name="m_0" maxlength="255">
			</td>
		</tr>	
	</table>
	<table cellspacing="0" cellpadding="0" class="form">
		<tr>
			<td align="center"><input type="button" onClick="addCurMed()" value="Add Medication"></td>
		</tr>
	</table>
</body>
</html>
This code works in mozilla firefox but not internet explorer...
Am I doing something wrong?

Thanks,

Nick

** EDIT ** Forgot to say what the script does...
Whenever the user clicks add medication it creates a new input box to be appended inside of the cMeds table... That way the user can create as many input boxes as needed..