ok so i have this code to start with
javascript
if(document.createElement) { //W3C Dom method.
var tr = document.createElement("tr");
var td = document.createElement("td");
var input = document.createElement("input");
input.id = field+count;
input.name = "the";
input.type = "text"; //Type of field - can be any valid input type like text,file,checkbox etc.
input.appendChild(td);
field_area.appendChild(td);
tr.appendChild(input);
field_area.appendChild(tr);
}
HTML
<strong>Enemies List</strong><br />
<table id="enemies_area">
<tr><td><input type="text" name="enemy_1" id="enemy_1" /></td></tr>
<tr><td><input type="text" name="enemy_2" id="enemy_2" /></td></tr>
<tr><td><input type="text" name="enemy_3" id="enemy_3" /></td></tr>
<tr><td><input type="text" name="enemy_4" id="enemy_4" /></td></tr>
<tr><td><input type="text" name="enemy_5" id="enemy_5" /></td></tr>
</table>
<input type="button" value="Add Friend Field" onclick="addField('enemy','enemies_area','enemy_',0);" />
</form>
it appends the input field and the tr properly but td's both append before the tr's.
i tried to find some type of documentation but no one has anything
thanks in advance