Why is this code working on jsfiddle but not my demo web page. It would be greatly appreciated if someone would be able to help me with this problem. Thanks and have a great day. I find it very weird why this is happening. Please help me out.
$('#img1').click(function() {
$('#aum').html('Text 1');
});
$('#img2').click(function() {
$('#aum').html('Text 2');
});
$('#img3').click(function() {
$('#aum').html('Text 3');
});
/** --OR-- you could get the images alt attribute and print that out
$('#aardvark').click(function() {
var alt = $(this).attr('alt');
$('div').html(alt);
});
**/
* { margin:0;padding:0; }
body { background:#E9EEF5; }
ul {
list-style-type:none;
width:900px;
margin:10px auto 0;
}
li {
margin:0 10px;
display:inline-block;
}
div {
font:20pt 'Georgia';
height:50px;
width:674px;
margin:20px auto 0;
text-align:center;
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<img src="http://tomroof.com/tinymonster/wp-content/uploads/2013/02/pic1.png" id="img1" alt="img1"/>
<img src="http://tomroof.com/tinymonster/wp-content/uploads/2013/02/pic2.png" id="img2" alt="img2"/>
<img src="http://tomroof.com/tinymonster/wp-content/uploads/2013/02/pic3.png" id="img3" alt="img3"/>
<div id="aum"></div>
<div>Another Div that shouldn't change</div>