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
What is the use of .size() method in jquery?
What is the between $(this) and 'this' in jquery?
How to read, write and delete cookies in jquery?
What does the jQuery migrate function do?
How you will use jquery means requirement needed for using jquery.
What is $() in jquery?
What is a filter in jquery? Explain
Tell me can we have multiple document.ready() function on the same page? : jquery mobile
Define cache paremeter of jquery ajax method?
Explain how jquery works?
Explain the basic need to start with jquery? : jquery mobile
Define .siblings() method in jquery?
Explain the concepts of "$ function" in jquery with an example?
What is the use of jquery.data()?
How to debug jquery code/ debug jquery?