SO - 18543892
HTML
<div class="questiontext">
20. Details of Children
</div>
<div id="question20" class="input">
<div class="question20">
Family Name<br>
<input type="text" name="children" class="childtextbox"><br>
Given Names<br>
<input type="text" name="children" class="childtextbox"><br>
Sex<br>
<input type="text" name="children" class="childtextbox"><br>
Date of Birth<br>
<select id="selectday3">
<option>Day</option>
<script>
var select = document.getElementById("selectday3");
var options = new Array();
var temp = 1;
for(var i = 0; i < 31; i++) {
options.push(temp);
temp++;}
for(var i = 0; i < options.length; i++) {
var opt = options[i];
var el = document.createElement("option");
el.textContent = opt;
el.value = opt;
select.appendChild(el);}
</script>
</select>
<select id="selectmonth3">
<option>Month</option>
<script>
var select = document.getElementById("selectmonth3");
var options = ["January", "Febuary", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
for(var i = 0; i < options.length; i++)
{
var opt = options[i];
var el = document.createElement("option");
el.textContent = opt;
el.value = opt;
select.appendChild(el);
}
</script>
</select>
<select id="selectyear3">
<option>Year</option>
<script>
var select = document.getElementById("selectyear3");
var options = new Array();
var firstyear = (new Date().getFullYear()) - 18;
var temp = firstyear;
for(var i = 0; i < 83; i++) {
options.push(temp);
temp--;}
for(var i = 0; i < options.length; i++) {
var...
JavaScript
$("#addArrival\\/Departure").click(function () {
$(".question21:last").after($(".question21:first").clone(true));
});
$("#deleteArrival\\/Departure").click(function () {
if ($(".question21").length != 1) $(".question21:last").remove();
});
$("#addChild").click(function(){
$(".question20:last").after($(".question20:first").clone(true));
});
$("#deleteChild").click(function() {
if($(".question20").length!=1)
$(".question20:last").remove();