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 |
How to debug jQuery?
How to resolve conflicts with other libraries?
What is the difference between jquery.size() and jquery.length?
Difference between prop() and attr()? : jQuery Mobile
Can you please explain the difference between body onload() and document.ready() function? : jquery mobile
Please explain remove class jquery with example?
What is the use of delegate() method in jquery?
What is serialize() in jquery?
What is method chaining in jquery?
What is jquery mobile theming? : jquery mobile
Which is the latest version of jQuery library?
Why jQuery is better than JavaScript?