javascript - A .clone is not working properly nor is it returning array of names -
my code supposed have 3 input boxes , when click "add set", should clone 3 input boxes. when click "get company names" should return array of company names, being of values boxes.
as stands, "add set" not work , not understand why. problem that, "get company names" returns object rather value .val suggest.
`alert($("#workexperiencebox").find("input[id=companyname1]").val(""));` also, in fiddle, see code using duplicate boxes. extraworkepxerience div , workexperience first div inside of div.
var workexperience = $("#workexperiencebox").clone(); $("#extraworkexperience").html(workexperience); the fiddle at. please help!
id has unique, had made id's have used classes. other problem using html() instead of append(), result make entire html content of container replaced.
var getnames = function(num) { alert($(".workexperiencebox").find(".companyname1").map(function() { return this.value; }).get()); } var addworkplace = function() { var workexperience = $(".workexperiencebox").clone(); $("#extraworkexperience").append(workexperience); }
Comments
Post a Comment