how can i update the contents of a dynamically created div as i type into an input field that was also created dynamically.
First i have an input that requests the number of code blocks i want:
$("#count-trigger").click(function(){
var count = $("#slide-count").val();
if (count !== "" && $.isNumeric(count)) {
var i = 1;
while (i <= count) {
$('.appendHere').append(
// Div I want to write to.
'<div 'id="slide-content_'+i+'">'Sample Title </div>'+
// Input field used to populate above div
' <input '+
' type = "text" '+
' name = "slide_name_'+i+'" '+
' data-target = "slide_name_'+i+'" '+
));
i++;
}
});
The above is pretty obvious, enter in a value press go and i get x number of divs/inputs.
Problem comes when trying to populate a created div as I type into created input.
Any help would be greatly appreciated.