Interview :: JQuery
31) Can you write a jQuery code to select all links inside the paragraph?
Yes. You can use tag nested inside paragraph tag to select all links. For example:
32) 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 is introduced in jQuery 1.6.
33) What are the two types of CDNs?
There are two types of CDN:
- Microsoft: It loads jQuery from AJAX CDN.
- Google: It loads jQuery from Google libraries API.
34) What is the use of the animate() method in jQuery?
The animate function is used to apply the custom animation effect to elements. Syntax:
Here,
- "param" defines the CSS properties on which you want to apply the animation.
- "duration" specify how long the animation run. It can be one of the following values: "slow," "fast," "normal" or milliseconds
- "easing" is the string which specifies the function for the transition.
- "callback" is the function which we want to run once the animation effect is complete.
35) How can you disable jQuery animation?
By using jQuery property "jQuery.fx.off" and setting it to true, you can disable jQuery animation.