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 |
In what scenarios jQuery can be used?
How do you attach a event to element which should be executed only once?
Can we select a element having a specific class in jquery ?
What is serialize() in jquery?
How do I check if an HTML element is empty using jQuery?
Define .siblings() method in jquery?
How can related code be encapsulated?
How to select class in jquery?
Explain which program is useful for testing jquery?
What are the browser related issues for jQuery?
Is jQuery replacement of Java Script?
How do you get the attribute of an html tag in jquery?