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

Tell me an example usage of jquery mobile? : jquery mobile

0 Answers  


What is the difference between jquery.size() and jquery.length?

1 Answers  


How to read, write and delete cookies in jquery?

0 Answers  


Is it too early to discuss jquery ui 1.8?

0 Answers  


Is it possible to use our own specific character in the place of $ sign in jquery? : jquery mobile

0 Answers  






How can events be prevented to work after an ajax request?

0 Answers  


Differentiate between calling stop (true, true) and finish method?

0 Answers  


What is a cdn? What are the advantages of using cdn?

0 Answers  


How to use connect in jquery?

0 Answers  


Define cache paremeter of jquery ajax method?

0 Answers  


How to create, read and delete cookies with jquery?

0 Answers  


How to get the current offset of the first matched element, in pixels, relative to the document using ?

0 Answers  


Categories