jQuery is a fast, lightweight, feature-rich client-side JavaScript library.
It is cross-platform and supports different types of browsers.
It has provided a much-needed boost to JavaScript. Before jQuery, JavaScript codes were lengthy and bigger, even for smaller functions.
It makes a website more interactive and attractive.
It is not a programming language but a well written JavaScript code.
It is a JavaScript code, which do document traversing, event handling, Ajax interactions and Animations.
Q2. Is jQuery a programming language?
jQuery is not a programming language but a well-written JavaScript code. It is used to traverse documents, event handling, Ajax interaction, and Animation.
Q3. Why jQuery is needed?
Used to develop browser compatible web applications
Very fast and extensible
Improve the performance of an application
UI related functions are written in minimal lines of codes
Q4. What are the advantages of jQuery?
Most popular and open source
Very fast and easily extensible
Commonly implemented UI related functionalities are written using minimal lines of codes
Reduction in the file size makes the web page load and work faster.
Used to develop cross browser compatible web applications as jQuery works in almost the same manner for different kinds of browsers.
Improves the performance of an application when using the minimised version of the jQuery library. The size of the minimized js file is almost 50% less than the normal js file.
Q5. What is the difference between JavaScript and jQuery?
JavaScript is an interpreted programming language, whereas jQuery is a library with APIs built for JavaScript. jQuery simplifies the use of the JavaScript language.
Q6. What are the features of jQuery?
DOM manipulation
Event handling
Animations
Cross Browser Support
AJAX Support
Lightweight
Q7. Is jQuery replacement of JavaScript?
No, jQuery is not the replacement of JavaScript. jQuery is written on the top of JavaScript, and it is a different library.
jQuery is a lightweight JavaScript library which is used to interact with JavaScript and HTML.
Q8. What are the methods used to provide effects?
Show()
Hide()
Toggle()
FadeIn() and
FadeOut()
Q9. Is jQuery a JavaScript or JSON library file?
jQuery is said to be a library of single JavaScript file which consists of DOM/CSS manipulations, event effects or animations, AJAX functions and various commonly used plugins.
Q10. What is jQuery Ajax?
AJAX is an acronym standing for Asynchronous JavaScript and XML, and this technology helps us load data and exchange data with the server without a browser page refresh.
JQuery is a great tool that provides a rich set of AJAX methods to develop next-generation web applications.
Q11. What are Selectors in jQuery?
A jQuery Selector is a function that uses the expressions to find out matching elements from a DOM based on the given criteria. In a simple language, selectors are used to select one or more HTML elements using jQuery. Once an element is selected then we can perform various operations on that selected element.
Selecting an element in DOM is done with the help of $() construct with a string parameter containing any CSS selector expression. $() will return zero or more DOM elements on which you can apply any effect or style.
Q12. What is $() in jQuery library?
The $() function is an alias of jQuery() function. It is used to wrap any object into jQuery object which later facilitates you to call the various method defined jQuery object.
You can pass a selector string to $() function, and it returns a jQuery object which contains an array of all matched DOM elements.
Q13. What is the advantage of using minimized version of jQuery?
Efficiency of web page increases when minimized version of jQuery is used.min.js file will be more than 50% less than the normal js file.
Reduction in the file size makes the web page faster.
Q14. Does jQuery work for both HTML and XML documents?
No. jQuery works only for HTML documents.
Q15. What are Events in jQuery?
Responding to user actions on a webpage is called events.
jQuery provides simple methods for attaching event handlers to selections. When an event occurs, the provided function is executed.
Q16. What is the use of css() method in JQuery?
The jQuery CSS() method is used to get or set style properties or values for selected elements. It facilitates you to get one or more style properties.
Q17. What is the difference between find and children methods?
Both the methods are used to filter the child of the matched elements. The find method is used to find all levels down the DOM tree, but the children method searches only a single level down the DOM tree.
Q18. What is jQuery.noConflict?
jQuery no-conflict is an option given by jQuery to overcome the conflicts between the different javascript frameworks or libraries.
When you use jQuery no-conflict mode, you replace the $ to a new variable and assign jQuery some other JavaScript libraries. Also, the $ is used as a function or variable name that jQuery has.
Q19. What is the use of toggle() method in JQuery?
The jQuery toggle() is a particular type of method which is used to toggle between the hide() and show() method. It shows the hidden elements and hides the shown element.
$(selector).toggle();
Q20. Which operating system is more compatible with jQuery?
Mac, Windows and Linux are more compatible with the jQuery.
Q21. Which command will give a version of jQuery?
The command $.ui.version returns jQuery UI version.
Q22. What is the difference between the ID selector and class selector in jQuery?
The ID selector and class selector are the same as they are in CSS.
ID selector uses ID while the class selector uses a class to select elements.
You use an ID selector to select just one element. If you want to select a group of elements, you can use the same CSS class to use the class selector.
Q23. In what scenarios jQuery can be used?
Apply CSS static or dynamic
Manipulation purpose
Mainly for Animation effects
Calling functions on events
Q24. Differentiate among .empty() vs .remove() vs .detach() in jQuery?
.empty() – This method is used to remove all the child elements from matched elements. $(selector).empty();
.remove() – This method is used to remove all the matched element. It will remove all the jQuery data associated with the matched element. $(selector).remove();
.detach() – This method is same as .remove() method except that the .detach() method doesn’t remove jQuery data associated with the matched elements. $(selector).detach();
Q25. What is the use of delay() method in JQuery?
The jQuery delay() method is used to delay the execution of functions in the queue. It is the best method to make a delay between the queued jQuery effects.
The jQUery delay() method sets a timer to delay the execution of the next item in the queue.
$(selector).delay (speed, queueName)
Q26. What is the use of html() method in JQuery?
The jQuery html() method is used to change the entire content of the selected elements.
It replaces the selected element content with new contents
A jQuery connect is a plugin used to connect or bind a function with another function. Connect is used to execute function from any other function or plugin is executed.
$.connect(obj1, 'fun1', onj1, fun2);
Q28. What are the browser related issues for jQuery?
Browser compatibility of jQuery plugin is an issue and needs lot of time to fix it.
Q29. What is the significance of jQuery.length?
jQuery.length property is used to count number of the elements of the jQuery object.
Q30. Is jQuery library used for server scripting or client scripting?
It is a library for client-side Scripting.
Q31. Is jQuery a W3C standard?
No, jQuery is not a W3C standard.
Q32. Can you tell something about jQuery each() method?
The each() method in jQuery allows us to loop through different datasets such as arrays or objects (even DOM objects).
It can be used to loop through a number of DOM objects from the same selectors.
We can also use each() to loop through the arrays of data and get the index and the value of the position of data inside the array.
You can also use each() to loop through objects.
Q33. What are the Advantages of jQuery Ajax methods?
Cross-browser support
Ability to Load JSON, XML, HTML or Scripts
Simple methods to use
Ability to send GET and POST requests
Q34. Differentiate between bind() vs live() vs delegate() methods in jQuery?
The bind() method does not attach events to those elements which are added after DOM is loaded.
Whereas, live() and delegate() methods attach events to the future elements as well.
The difference between live() and delegate() methods is live() function does not work in chaining. It will work only on a selector or an element.
But delegate() method works in chaining.
Q35. What are the basic selectors in jQuery?
Element ID
CSS Name
Tag Name
DOM hierarchy
Q36. Can you use any other name in place of $ (dollar sign) in jQuery?
Yes, instead of $ (dollar sign) we can use jQuery as a function name.
Q37. What is the difference between onload() and document.ready() methods?
Body.Onload() event will be called only after the DOM and associated resources like images get loaded.
JQuery's document.the ready() event will be called once the DOM is loaded, and it does not wait for the resources such as images to be loaded.
Q38. Can you use multiple document.ready() function on the same page?
Yes. You can use any number of document.ready() function on the same page.
Q39. Is jQuery required for bootstrap?
Bootstrap uses jQuery for JavaScript plugins (like models, tooltips, etc.). However, if you just use the CSS part of Bootstrap, you don't need jQuery.
Q40. What is the use of param() method in jQuery?
The param() method is used to represent an array or an object in a serialized manner. While making an ajax request we can use these serialize values in the query strings of URL.
Q41. What is a CDN?
CDN stands for Content Delivery Network or Content Distribution Network.
It is a large distributed system of servers deployed in multiple data centers across the internet. It provides the files from servers at a higher bandwidth that leads to faster loading time. These are several companies that provide free public CDNs.
Google
Microsoft
Yahoo
Q42. What are the four parameters used for jQuery Ajax method?
1. URL – Need to specify the URL to send the request 2. type – Specifies type of request(Get or Post) 3. data – Specifies data to be sent to server 4. Cache – Whether the browser should cache the requested page
Q43. What is a use of jQuery filter?
jQuery filter is used to filter the specific values from the object. It filters the result of your original query into specific elements.
Q44. What is jQuery Mobile?
jQuery Mobile is an HTML5-based user interface system designed to make responsive websites and apps accessible on all smartphones, tablets, and desktop devices.
Q45. Which is the fastest selector in jQuery?
ID and Element are the fastest selectors in jQuery.
Q46. What is the use of val() method in JQuery?
To get the current value of the first element in the set of matched elements.
To set the value of every matched element.
$(selector).val();
Q47. What is jQuery UI?
jQuery UI is a set of user interface interactions, effects, widgets, and themes built on top of the jQuery JavaScript Library.
jQuery UI works well for highly interactive web applications with many controls or for a simple page with a date picker control.
Q48. What is the difference between prop and attr?
attr(): It gets the value of an attribute for the first element in the set of matched element.
prop(): it gets the value of a property for the first element in the set of matched elements. It's introduced in jQuery 1.6.
Q49. What is the slowest selector in jQuery?
Class selectors are the slowest selectors in jQuery.
Q50. What is difference between $(this) and this in jQuery ?
this and $(this) refer to the same element but the difference is that 'this' is used in a traditional method but with $() it becomes a jQuery object on which we can use the functions of jQuery.
Q51. What are jQuery plugins?
Plugins are a piece of code. The jQuery plugins are a code written in a standard JavaScript file.
These JavaScript files provide useful jQuery methods that can be used along with jQuery library methods.
Cookie Policy
This website uses cookie or similar technologies, to enhance your browsing experience and provide personalised recommendations. By continuing to use our website, you agree to our Cookie Policy.