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 redirect to another page using jquery?
What is the difference between prop() and attr() in jquery?
Define the types of selectors in jquery?
Create a plugin that would add and remove a class on hover.
What are the methods used to provide effects?
Explain animate function in jquery?
Define animate function in jquery?
How do you check or uncheck a checkbox input or radio button?
How to select all elements using jQuery?
Is jquery a library for client scripting or server scripting? : jquery mobile
How can we apply css in odd childs of parent node using jquery library?
What are selectors in jquery? : jQuery Mobile