jQuery Interview Questions FAQ
Please click on the questions to see the answers
Using typeof operator, we can get the type of arguments passed to a function.
You can use $('*') to select all elements available in a DOM.
jQuery .attr() method is used for getting the value from the first matched element.
jQuery css() method sets or returns one or more style properties for the selected elements.
The innerHTML property sets or returns the HTML content (inner HTML) of an element.
The jQuery append() method inserts specified content at the end of the selected elements.
jQuery bind() function is used to attach an event handler to elements, while the unbind() is used to detached an existing event handler from elements.
The delay() method sets a timer to delay the execution of subsequent items in the queue.
Once you have used jQuery.noConflict, the control of $ is handed over to other libraries rather than jQuery and in this case, you will have to use jQuery rather than $.
The jQuery stop(true, true) method will be quite similar to finish() method. Both methods helps in clearing the queue and thereby helps the animations to enter into their end state. In .finish() it also causes the CSS property of all queued animations to jump to their end values, as well.
jQuery stop() method stops the currently running animation on the matched elements.
This will select all the P elements (Paragraph) on page.
ID and element selectors are the fastest selectors in jQuery.
The jQuery.fx.off property is used to globally disable/enable all animations.
jQuery clone() method makes a copy of selected elements, including child nodes, text and attributes.
By Default clone method does not clone the events unless it is being instructed to copy. When “clone” method is being instructed to clone the events also then along with elements, events are also being copied. The clone() method takes a parameter, if you pass true then it will copy the events as well.
A clone(true) indicating whether event handlers should be copied along with the elements.
- jQuery Interview Questions FAQ - 1
- Is jQuery a programming language?
- Why do we need to go for JQuery?
- How to check jQuery version?
- How to multiple version of jQuery?
- What is jQuery CDN?
- Advantages of minified version of JQuery
- How do I check if the DOM is ready?
- How to Use the jQuery load() Method
- Difference between document.ready() and body onload()?
- What is the use of param() method?
- How to work with jQuery parent(), children() and siblings()?
- Difference between parent() and parents() in jQuery?
- What does jQuery data() function do?
- How do you check if an element exists or not in jQuery?
- How do I check if an HTML element is empty using jQuery?
- How to run an event handler only once in jQuery?
- How to disable/enable an element with jQuery
- Hide and show image on button click using jQuery
- Difference Between Prop and Attr in jQuery
- How do I check if an element is hidden in jQuery?
- What happen if you return false from a jQuery event handler?
- What is each() function in jQuery? How do you use it?
- Which one is more efficient, document.getElementbyId( "myId") or $("#myId)?
- What is the difference between $.map and $.grep in jQuery
- What is the use of serialize method in jQuery
- What is the use of clone method in jQuery?
- What is event.PreventDefault in jQuery?
- Difference between event.PreventDefault and event.stopPropagation?
- What are deferred and promise object in jQuery?