javascript - Generate input field using jQuery's append -
issue: attempting append input field modal window, containing value inserted user, existing panel. far user able create new field modal , add it, however, part of edit page, want input added input field. here working code: bootply example. want newly generated field formatted same existing fields because become part of giant form allowing submitted , update operational page.
question: have format within append function declare other formatting constraints? or can somehow set attributes within 'cloudcontainer' div input being appended to? also, should using .html function instead of append? performance not concern here.
thanks
you have append same formatted input
tag have generated in beginning , add form value it
$("#clickme").click(function(){ $('.cloudcontainer').append('<div class="cloud"><p><b>'+$('#fieldtitle').val()+': </b><input style="display: inline; width: 325px;" class="form-control" id="projectname" type="text" value="'+$('#fieldvalue').val()+'" </input></p></div>'); });
Comments
Post a Comment