Hi, so i have an input text <input type="text" name="numguest" id="number-of-guests">
and a button Okay
. When a number say, 4 is entered into that text box and clicked okay, 4 of this text box <input type="text" name="guest-name[]" placeholder="Guest Name" id="text-gname">
will appear.
i tried:
$("#okay").on("click", function(){
var num_of_guests = $("#number-of-guests").val();
alert(num_of_guests);
var input_text = $("#text-gname").clone();
var target = $(".guests-tbody");
for(var i = 0; i < num_of_guests; i++)
{
var clone = input_text.clone();
clone.attr('id','style', '');
target.append(clone);
Hide();
}
});
but nothing seems to be happening except fot the alert and Hide function. TIA