Web Development Ninjas Question:
Download Questions PDF

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

Ninjas Web Developer Interview Question
Ninjas Web Developer Interview Question

Answer:

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.

Download Ninjas Web Developer Interview Questions And Answers PDF

Previous QuestionNext Question
Do you know the real difference between HTML and HTML5?Do you know what is the difference between jQuery.get() and jQuery.ajax() method?