I have this very simple jquery script:
$(document).ready(function() {
$("h2").click(function(){
alert("Hello world");
})
});
When I click on any h2 on the entire site, an alert will show up.
This works fine when I put an h2 anywhere in my index.html but when I put the h2 in some of the files included by angular, nothing happens when I click on the h2.
These are my files
index.htm
included.htm
myjqueryfunctions.js
Here is how I include the jquery-file
<body>
.... some code ....
<script src="jquery_functions.js"></script>
</body>
Here is how I include the HTML-file using angular
<div ng-include src=" 'included.htm' "></div>
Everything else is working fine.
Question: Why does my jquery-script work fine when I put the h2 in my index.html but not when it is in the included.html