Front End Programmer Question: Download Front End Developer PDF
Using jQuery how would you hide the image when the user clicks it for the following code snippet?
<div class="content">
<p>Some Content Here</p>
<p class="loader"><img src="ajax-loader.gif"></p>
</div>
Answer:
$(document).ready(function(){
$('.loader img').click(function() {
$('.loader img').hide();
$('.loader img').hide();
});
});
$('.loader img').click(function() {
$('.loader img').hide();
$('.loader img').hide();
});
});
Previous Question | Next Question |
Do you know what is a sprite? How is it applied using CSS? What is the benefit? | How to increase page performance? |