Tell me how do you hide an image on a button click using jQuery?

Submitted by: Muhammad
This jQuery interview question is based on event handling. jQuery provides good support for handling events like button click. You can use following code to hide an image, found using Id or class. What you need to know is the hide() method and how to setup an even handler for button, to handle clicks, you can use following jQuery code to do that :

$('#ButtonToClick').click(function(){
$('#ImageToHide').hide();
});

I like this jQuery question, because it's like a practical task and also code is not difficult to write.
Submitted by: Muhammad

Read Online Web Development Ninjas Job Interview Questions And Answers