For some reason, we have a page, mainpage.html with sections wrapped in <template>...</template>
tags.
Ordinarily, the sections are not rendered on page load, but is there a way to get jquery to be able to
acccess a div within a <template>
tag on loading page mainpage.html and execute the following script:
<script type="text/javascript">
$(document).ready(function() {
$("#inner-div").click(function(e) {
alert('The div was clicked');
})
});
</script>
Assuming mainpage.html is:
<html>
<head>
<script src="/path/to/jquery"></script>
<script type="text/javascript">
$(document).ready(function() {
$("#inner-div").click(function(e) {
alert('The div was clicked');
})
});
</script>
</head>
<body>
<template id="temp1">
<div id="inner-div"> </div>
</template>
<template id="temp2">
</template>
<template id="temp3">
</template>
</body>
</html>