What's wrong with my code?
<script>
var UrlNumber;
function addMoreUrl()
{
if(document.getElementById("accept").checked == false)
{
alert("Please acceept");
return false;
}
var div = document.createElement("div");
var link = document.createElement("a");
var url = document.createElement("input");
var send = document.createElement("input");
url.setAttribute("type", "text");
url.setAttribute("id", 'url'+UrlNumber);
url.setAttribute("size", "60");
url.setAttribute("name", 'url'+UrlNumber);
//url.setAttribute("onchange", alert("url todo"));
link.setAttribute("href", "javascript:removeUrl('url"+UrlNumber+"');");
link.appendChild(document.createTextNode("Entfernen"));
div.setAttribute("id", "url"+UrlNumber);
send.setAttribute("type", "checkbox");
send.setAttribute("id", 'check'+UrlNumber);
div.appendChild(url);
div.appendChild(link);
div.appendChild(send);
document.getElementById("moreUrl").appendChild(div);
if(document.getElementById('check'+UrlNumber).checked == true)
{
alert("checked");
}
UrlNumber++;
}
function removeUrl(urlElement)
{
var element = document.getElementById(urlElement);
document.getElementById("moreUrl").removeChild(element);
UrlNumber--;
}
</script>