I am using the code below to load html into my page:
$(document).ready(function () {
$('#loadingArea').load('includes/template1.html');
});
It works great but for some reason when I use any query to target any divs belonging to the loaded html file it won't work for example:
template1.html contains:
Button Inside the Template
If I try to use:
$("#mybutton").click(function(){
alert('Something');
});
It will not work.
How can I fix this?