<script>
$("a").click(function () {
$("#wrapper").fadeOut("slow");
});
</script>
<div id="wrapper" >
<a href="1.html"> <img src="images/landing.png"/></a>
</div>
I have checked the jquery documentation but it has not solved the problem, have tried to substitute different selectors
You are executing the script before the DOM is loaded. The jQuery call
$("a")executes promptly before the<a>tag is defined and henceclickisn’t bound to anything. To fix use the ready function which executes after<a>is available.JSFiddle Example – http://jsfiddle.net/Vkd8J/