I am interested in checking whether some checkboxes are checked to send a ajax call. But these checkboxes were created dynamically and I cannot do this using selectors. First I was thinking about checking how many checkboxes are, in the containing div element. But this seems to be impossible. My code in general looks like this.
function setup(){
//.... Some data is appended in a container. The data is gotten from a php script
}
function update {
//... this function reads values from elements from page, works with selectors for static elements, selectors, don't work with dynamic ones
}
$(document).ready(function() {
setup();
update();
});
So basically the dynamic element's are appended to the HTML when setup is called. Then when calling update and I am to retrieve data I cannot. For example (in update(), where #boje is an element generated dynamically setup):
var temp = $("#boje").children().length;
alert(temp);
I get 0. When I should really get 5, for a given example. Meaning that this isn't how it is supposed to be done. How do I do this?