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

How to load jQuery locally when CDN fails?

1 Answers  


Tell me how to check data type of any variable in jquery? : jquery mobile

0 Answers  


What does $("div") will select?

1 Answers  


How does jquery mobile theming work? : jquery mobile

0 Answers  


What does dollar sign ($) me in jquery?

0 Answers  






What is the purpose of fadetoggle() method in jquery?

0 Answers  


How can we add change font size using jquery?

0 Answers  


In jquery, what is the meaning of toggle?

0 Answers  


In what scenarios jQuery can be used?

0 Answers  


Difference between document.ready() and body onload()?

0 Answers  


Explain various methods to make ajax request in jquery?

0 Answers  


What is the difference between calling stop(true,true) and finish method?

1 Answers  


Categories