My Javascript something like this
$('button').click(function(){
//load the data and place inside to #content
});
$('#id-from-data-that-load').click(function(){
//Do some action
});
So this is html tag
<button>Load</button>
<div id="content">
//Empty Data
</div>
when button LOAD clicked html will be like this
<button>Load</button>
<div id="content">
<div id="id-from-data-that-load">
content that load
</div>
</div>
BUT, when i clicked div id-from-data-load the function won’t run.
How to solve it?
You need to use live for the div event instead. Here’s what it should be:
Or alternatively you could also do this: