guys, currently I'm working on a project where I need to load some data through AJAX. I'm using jQuery for AJAX. Here are the HTML and JavaScript code
<body>
<input type="submit" value="Number 1">
<script src="jquery.js"></script>
<script>
$(document).ready(function(){
$.ajax('ajax.html',{
success: function(data){
$('body').append(data);
}
});
$('input').click(function(){
alert('bang!!!');
});
});
</script>
</body>
And here is the ajax.html file
<input type="submit" value="Number 2">
Now the AJAX is working perfectly, but the click event is not working with the AJAX loaded input tag
The click event is working perfectly with the first input tag