I am completely new to HTML5 and jQuery. Busy converting from ActionScript to HTML5 and JavaScript. I am building a page with menu list that loads two sets of images. Occasionally I need the 2nd image to be clickable to load new content. Please see attached code. I do not get the click on the 2nd image to activate the alert. Any help would be greatly appreciated.
<html>
<head>
<title>Frames Test</title>
<script type="text/javascript">
function LoadContent(id1, id2, id3, id4, id5, id6, id7, id8){
var img01 = document.getElementById('BlowoutImage');
var img02 = document.getElementById('BackgroundImage');
paragraph01 = document.getElementById('title');
paragraph02 = document.getElementById('footnote');
var heading = id2;
img01.src = id1;
img02.src = id5;
img02.style.top = id7;
img02.style.left = id8;
paragraph01.innerHTML = heading
paragraph01.style.left = id3
paragraph01.style.top = id4
paragraph02.innerHTML = id6
if(id5=='images/systemboard_btn_01.png'){
$(document).ready(function(){
$("#BackgroundImage").click(function () {
alert("CLICKED")
});
});
return false;
}
}
</script>
</head>
<body id="mainbody">
<p id="title" style="position: absolute; top:30px; left:400px; "></p>
<p id="footnote" style="position: absolute; top:650px; left:600px; "></p>
<p>
<ul id="menubar">
<li ><a id="item10" class="list-group-item" href="#" onclick = "LoadContent('images/pun_6u_background2_500W.png', 'System board', '550', '140', 'images/systemboard_btn_01.png', '', '550', '650')">System board</a></li>
</ul>
<img id="BlowoutImage" STYLE="position:absolute; TOP:50px; LEFT:20%;" src="" >
<img id="BackgroundImage" STYLE="position:absolute; TOP:30%; LEFT:18.5%;" src="images/cr2_front_open_500W.png" >
</p>
</body>
</html>