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

Define jquery $.ajax() method?

0 Answers  


What is the use of param() method?

0 Answers  


Explain type paremeter of jquery ajax method?

0 Answers  


Explain animate function in jquery?

0 Answers  


What's next on the hitlist with jquery ui?

0 Answers  


What is the use of jQuery.data() method?

0 Answers  


Where jQuery code is getting executed?

0 Answers  


What are the types of selectors that are used in jquery? Give examples.

0 Answers  


How to find all sibling elements after the current element using ?

0 Answers  


How you will use jquery means requirement needed for using jquery.

0 Answers  


List a few features of jquery mobile? : jQuery Mobile

0 Answers  


Explain each() function in jquery?

0 Answers  


Categories