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 resolve conflicts with other libraries?
How to write browser specific code using jQuery?
What is the difference between prop() and attr() in jquery?
How can jquery be used in conjunction with another javascript library that also uses $ for naming?
What programming language does jquery use?
What is jQuery?
What is a cdn? What are the advantages of using cdn?
What is jquery toggle function?
What are the browser related issues for jQuery?
Which version of jquery file should be used?
Tell me how to write browser specific code using jquery? : jquery mobile
Where can we download JQuery?