I am trying to hide an element when an image with the ID of 'close' is clicked.
$('#close').click(function() {
$('#ordercell').hide('slide');
});
Should be all I need, from what I can tell, but nothing is happening when I click.
$(document).keyup(function(event) {
if (event.keyCode ==27) {
$('#ordercell').hide('slide');
}
});
Is working just fine to hide when escape is pressed, so I'm not quite sure what I'm missing.
My HTML is (not using an image ATM because i figured i'd get the script working before i made one):
<div id="ordercell">
<div id="orderform">
<div class="cardorder" id="cardorder56">
<div id="close">X</div>
<img src="foo.jpg">
</div>
</div>
</div>
This is all hard coded, no AJAX.