Explore topic-wise InterviewSolutions in .

This section includes InterviewSolutions, each offering curated multiple-choice questions to sharpen your knowledge and support exam preparation. Choose a topic below to get started.

151.

How Can We Give Fade Effect In J Query?

Answer»
  • In jQuery we have three methods to give the fade effect to elements: fadeIn, fadeOut and fadeTo
  • This methods change the opacity of element with animation.

Syntax:

$(SELECTOR).fadeIn(speed,callback) $(selector).fadeOut(speed,callback) $(selector).fadeTo(speed,opacity,callback)
  • “speed” can be ONE of FOLLOWING values : “SLOW”, “fast”, “normal” or milliseconds
  • “opacity” specify the value that allows the fading to given opacity.
  • “callback” is the FUNCTION which we want to run once the fading effect is complete.

For example

$("clickme").click(function(){
$("mydiv").fadeTo("slow",0.50); });
$("clickme").click(function(){
$("mydiv").fadeOut(3000); });.

Syntax:

For example

152.

What Is Jquery Selectors? Give Some Examples?

Answer»
  • jQuery Selectors are used to select one or a group of HTML ELEMENTS from your web PAGE.
  • jQuery support all the CSS selectors as well as many additional custom selectors.
  • jQuery selectors ALWAYS start with dollar sign and parentheses: $()

There are three building blocks to select the elements in a web DOCUMENT.

  1. Select elements by tag name Example: $(div) It will select all the div elements in the document.
  2. Select elements by ID Example: $(#xyzid”) It will select single element that has an ID of xyzid
  3. Select elements by class Example: $(“.xyzclass”) It will select all the elements having class xyzclass

There are three building blocks to select the elements in a web document.