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 |
What is parseint() and why it is used?
What is jquery selectors?
What is the purpose of fadetoggle() method in jquery?
List a few features of jquery mobile? : jQuery Mobile
Explain the difference between parent() and parents() methods in jquery? : jquery mobile
Define jquery connect?
Jquery can be used in what scenarios?
What are the browser related issues for jQuery?
How to get the style property of an element using ?
How do you select all elements with the class of “selected” in jquery?
How to run an event handler only once in jQuery?
What is the use of jquery .each() function?