using jquery i am adding new elements to a div element i also have set id of new added element but still javascript can not find that newly added elements.
$.ajax({ //ajax call
type: "POST",
url: "ajax/ajax.php",
data: { users: values }
}).done(function( msg ) {
//do something with msg which is response
//this line will put the response to item with id `#txtHint`.
$("#divselect").html(msg)
//alert(msg);
});
});
new elements added successfully but on button click javascript can not find that new element id. is there any way to reload only javascript or what should i do ?
$("#validator").click(function (){//validator is my submit button id
var value = document.getElementById('select_division'); //select_division is id of my new added element
alert(value);
}
then comes reference error. on this.