I have html div which loads empty when the page is first loaded. After that I can click a button which will load fresh html into the div using jquery ajax
$("#control-list a#ms").click(function(){
var postData = "actionrequest=ms";
$.ajax({url:"SSSutility.php", type:"post", data:postData, success:function(dataset){
$("#data-area").html(dataset);
}});
});
This html has additional buttons inside it when I want to target. Because the JS script is loaded with the original HTML page it cannot target this new html without reloading the JS file that contains the script for the inner buttons. What I'm trying to do is find a way to not have to reload the script in the html response. So far I can only find code which targets the AJAX response on the way in and then triggers a method to run. I need to be able to target the new HTML from a separate method so it is tied to the button clicks.