Is it possible to get value of multiple CSS properties in single statement?



Is it possible to get value of multiple CSS properties in single statement?..

Answer / chaitanya

Well, before jQuery 1.9 release it was not possible but one of the new feature of jQuery 1.9 was .css() multi-property getter.

Hide Copy Code

var propCollection = $("#dvBox").css([ "width", "height", "backgroundColor" ]);

In this case, the propCollection will be an array and it will look something like this.

Hide Copy Code

{

width: "100px",

height: "200px",

backgroundColor: "#FF00FF"

}

Is This Answer Correct ?    1 Yes 0 No

Post New Answer

More jQuery Interview Questions

What are two different version of jquery library? : jquery mobile

0 Answers  


Is vanilla js faster than jquery?

0 Answers  


Explain cdn in jquery?

0 Answers  


Why do we use jquery? : jquery mobile

0 Answers  


Is jquery a w3c standard? : jquery mobile

0 Answers  






What are the fastest selectors in jQuery?

1 Answers  


What are the methods used to provide effects in jquery?

0 Answers  


Please tell us that is jquery knockkout intended to compete with jquery or prototype or work with it?

0 Answers  


Need to add jQuery file in both Master and Content page?

0 Answers  


Explain the basic need to start with jquery? : jquery mobile

0 Answers  


Does jquery follow w3c recommendations?

0 Answers  


How to find grand children in of an element?

0 Answers  


Categories