Is it possible to get value of multiple CSS properties in single statement?
Answer Posted / 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 |
Post New Answer View All Answers
Can you please explain the difference between .js and .min.js? : jquery mobile
How to concatenate two strings using jquery?
What are all the ways to include jQuery in a page?
Is jquery a library for client scripting or server scripting? : jquery mobile
How to use connect in jquery?
How we can apply css in multiple selectors in jquery?
Which sign is used as a shortcut for jQuery?
Explain the difference between jquery-x.x.x.js and jquery.x.x.x min.js?
What is serialize() in jquery?
What is the difference between find and children methods?
What is the use of jQuery filter?
How can you select all elements in a page using jquery?
Explain event.preventdefault? : jquery mobile
What are the types of selectors that are used in jquery? Give examples.
What is a filter in jquery? Explain