when the content of the page is loaded working fine, but when the div tag that found in the content of another page loaded by AJAX, javascript not working on this div,
<?php //somePhpHere ?>
<!DOCTYPE html>
<html lang="en">
<head>
//bla blah
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script src="../js/scripts.js"></script>
<script >
$(document).ready(function(){
$("#tableSearch").on("keyup", function() {
var value = $(this).val().toLowerCase();
$("#myTable tbody tr").filter(function() {
$(this).toggle($(this).text().toLowerCase().indexOf(value) > -1)
});
});
});
</script>
</head>
<body>
<ul class="list-unstyled">
<li><a href="#" class="waves-effect" id="spde">Supervisor Details</a>
</li>
<li><a href="#" class="waves-effect" id="spre">Supervisor Registration</a>
</li>
</ul>
<div class="jscontent" style="padding-top:100px">
</div>
</body>
</html>
here is the .js file
$(document).ready(function(){
$('.jscontent').load('contetntco.php #home');
$('a').click(function(){
var clickedLink1 = $(this).attr('id');
$('.jscontent').load('contetntco.php #' + clickedLink1);
})
});
content page
<div id="cmde">
<input class="form-control mb-4" id="tableSearch" type="text">
<table id="myTable" >
//bla bla
</table>
</div>
when the content of the page is loaded working fine, but when the div tag that found in the content of another page loaded by AJAX, javascript not working on this div,