Test Series - html

Test Number 48/72

Q: jQuery does not contain the _____________ feature.
A. AJAAX
B. AJAX
C. CSS manipulation
D. Effects and animations
Solution: jQuery contains many features like CSS manipulation, AJAX, Effects, and animations, Utilities, HTML event methods, HTML/DOM manipulation. There are also jQuery plugins for every given task. jQuery simplifies complicated things in JavaScript.
Q: What is the correct syntax of jQuery?
A. action().$(selector)
B. $(selector).action()
C. (selector)$.action()
D. action().(selector)$
Solution: The basic syntax of jQuery is $(selector).action(), $ sign defines access of jQuery, (selector) is HTML element, action() is for the jQuery action that is to be performed. E.g. $(“h1”).hide(), this will hide all the 

elements.

Q: In jQuery all the elements are selected by writing ____________
A. $(this)
B. $(“:button”)
C. $(“*”)
D. $(“.class_name”)
Solution: In jQuery all the elments are selected by writing $(“*”). $(this) helps in selecting current HTML element. All the button elements are selected by writing $(“:button”). If we want to select a specific class we should write $(“.class_name”).
Q: Which of the following is not event method in jQuery?
A. click()
B. mouseenter()
C. mousedown()
D. hide()
Solution: The actions that can be performed on the web page are called events. Some common DOM events are blur(), click(), bilnd(), change(), dbclick(), eroor(), delegate(), die(), event.data, event.currentTarget, event.pageX, mouseenter(), mousedown(), event.result, event.target, focus(), hover(), keydown(), focusout(), live(), load(), keyup() etc.
Q: hover() method is the combination of ____________
A. mouseleave() and mouseeneter()
B. mousedown() and mouseenter()
C. mouseup() and mousedown()
D. mouseleave() and mousedown()
Solution: hover() method is the combination of mouseleave() and mouseenter(). It takes two functions. When the mouse leaves HTML element then mouseleave() function is called and when mouse enters HTML element then mouseenter() function is called.
Q: Which of the following is not the fade method in jQuery?
A. fadeTo()
B. fadeOn()
C. fadeOut()
D. fadeIn()
Solution: jQuery has various fade methods including fadeout(), fadeTo(), fadeToggle(), fadeIn().
The syntax of fadeIn() is $(selector).fadeIn(speed,callback);
For fadeout() we use $(selector).fadeOut(speed,callback);
For fadeToggle we use $(slecetor).fadeToggle(speed,callback);
For fadeTo() syntax is $(selector).fadeTo(speed,opacity,callback).
Q: Which of the following is not the sliding method in jQuery?
A. slideToggle()
B. slideDown()
C. slideUp()
D. slideIn()
Solution: jQuery have three slide methods namely slideUp(), slideDown() and slideToggle().
Syntax for slideDown() is $(selector).slideDown(speed,callback);
For slideUp() we use $(selector).slideUp(speed,callback).
For slideToggle() method the syntax is $(selector).slideToggle(speed,callback).
Q: Which of the following is not the jQuery method for manipulation?
A. stop()
B. html()
C. text()
D. val()
Solution: For attributes manipulation we use three methods named html(), text() and val(). The content of selected elements is returned by html(). The text content of selected elements is returned by text(). The values of form fields is returned by val().
Q: The method not used to add new content is ___________
A. after()
B. prepend()
C. before()
D. add()
Solution: In jQuery there are four methods to add new content namely prepend(), before(), after(), append(). The append() method inserts at the end, prepend() method inserts at the beginning of the content, after() method inserts the content after selected HTML element, befor() inserts before the selected HTML element.
Q: Which method is not used for CSS manipulation?
A. toggleClass()
B. removeClass()
C. beforeClass()
D. css()
Solution: There are several functions for CSS manipulation. Some of them are css(), removeClass(), toggleClass(), addClass(). The style attribute is returned by css() method. Classes are added by addClass() method. Classes are removed by removeClass() method. The toggling between adding and removing classes is achieved by toggleClass() method.

You Have Score    /10