Hi,
I have this javascript at the top of my php document on my website:
<script type="text/javascript">
document.getElementById('add').addEventListener('click', function(event) {
event.preventDefault();
var select = document.getElementById('select').cloneNode(true);
document.getElementById('form').appendChild(select);
}, false);
</script>
In the body of the php document there is a form :
<form id="form">
<select id="select">
<option>one</option><option>two</option><option>three</option>
</select>
<button id="add">Add</button>
</form>
For some reason i cant get this code to work. It is meant to add another dropdown list to the document. Are there any errors?
Thanks