250+ TOP MCQs on Essential JavaScript and jQuery

HTML Multiple Choice Questions “Essential JavaScript and jQuery”.

1. jQuery does not contain the _____________ feature.
a) AJAAX
b) AJAX
c) CSS manipulation
d) Effects and animations

Answer: a
Clarification: 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.

2. What is the correct syntax of jQuery?
a) action().$(selector)
b) $(selector).action()
c) (selector)$.action()
d) action().(selector)$

Answer: b

3. In jQuery all the elements are selected by writing ____________
a) $(this)
b) $(“:button”)
c) $(“*”)
d) $(“.class_name”)

Answer: c
Clarification: 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”).

4. Which of the following is not event method in jQuery?
a) click()
b) mouseenter()
c) mousedown()
d) hide()

Answer: d
Clarification: 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.

5. hover() method is the combination of ____________
a) mouseleave() and mouseeneter()
b) mousedown() and mouseenter()
c) mouseup() and mousedown()
d) mouseleave() and mousedown()

Answer: a
Clarification: 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.

  250+ TOP MCQs on URL Encoding and Answers

6. Which of the following is not the fade method in jQuery?
a) fadeTo()
b) fadeOn()
c) fadeOut()
d) fadeIn()

Answer: b
Clarification: 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).

7. Which of the following is not the sliding method in jQuery?
a) slideToggle()
b) slideDown()
c) slideUp()
d) slideIn()

Answer: d
Clarification: 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).

8. Which of the following is not the jQuery method for manipulation?
a) stop()
b) html()
c) text()
d) val()

Answer: a
Clarification: 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().

9. The method not used to add new content is ___________
a) after()
b) prepend()
c) before()
d) add()

Answer: d
Clarification: 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.

10. Which method is not used for CSS manipulation?
a) toggleClass()
b) removeClass()
c) beforeClass()
d) css()

Answer: c
Clarification: 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.

  250+ TOP MCQs on Responsive Overview and Answers

11. Which of the following is not a jQuery dimension method?
a) innerWidth()
b) outerHeight()
c) height()
d) css()

Answer: d
Clarification: There are various important methods for dimension. Some of them are height(), innerHeight(), outerWidth(), outerHeight(), width(), innerWidth(). Width() method includes border, margin and padding. innerWidth() and innerHeight() method includes padding. outerHeight() and outerWidth() method includes border and padding. CSS() method is used for CSS manipulation in jQuery.

12. Which method is not used for traversing DOM tree?
a) parent()
b) parentsUntil()
c) parents()
d) after()

Answer: d
Clarification: There are three methods for the traversal of DOM tree. Parent(), parentsUntil(), parents(). Direct parent element is returned by parent() method. All the ancestor elements are returned by parents() method. All the ancestor elements that are between given two arguments are returned by parentsUntil() method.

13. Which method is not for traversing DOM tree sideways?
a) parent()
b) siblings()
c) prev()
d) nextAll()

Answer: a
Clarification: There are methods for traversing DOM tree sideways. Some of them are next(), prev(), prevAll(), nextAll(), siblings(), prevUntil(), next(). All the sibling elements are returned by siblings() method. The next sibling is returned by next() method. All the next siblings are returned by nextAll() method.

14. Which method is not used for filtering in jQuery?
a) next()
b) first()
c) eq()
d) last()

Answer: a
Clarification: The basic filtering methods are eq(), not(), filter(), last() and first(). The first element is returned by first() method, last element is returned by last() method, the specific index number of element is returned by eq() method.

  250+ TOP MCQs on Search Engine Optimization & Old Browser vs New Elements

15. AJAX is not used in _____________
a) Gmail
b) Youtube
c) Facebook
d) Yahoo

Answer: d
Clarification: AJAX stands for Asynchronous JavaScript and XML. AJAX loads data in the background and then displays it on the webpage. The application of AJAX is on Gmail, Youtube, Facebook and Google Maps tabs. Several methods for AJAX functionality is provided by jQuery.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top