I can't add inputs to a new div using functions
Clash Royale CLAN TAG#URR8PPP
I can't add inputs to a new div using functions
sorry, but I don't know much about html css and all that.
I found a problem when trying to create a template in django.
When i wanting to add inputs to a second div created I can not. Automatically adds everything to the first div.
This is my code:
<button id="Add">Add</button>
Scripts:
<script>
$(function()
$('#Add).click(function()
var div = $('<input type="text" id="member" name="member" value="">Num<a type="button" id="filldetails" onclick="addFields()">Add</a></div><div id="container" />'
);
$(".body").append(newDiv);
);
);
</script>
Second:
<script type='text/javascript'>
function addFields()
var number = document.getElementById("member").value;
var container = document.getElementById("container");
for (i=0;i<number;i++)
var input = document.createElement("input");
input.type = "text";
container.appendChild(input);
</script>
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.
Having multiple elements with the same ID is invalid HTML. You should fix that first.
– CertainPerformance
22 secs ago