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 |
JQuery or JavaScript which is quicker in execution?
What is the use of toggle() method in jquery?
List a few features of jquery mobile? : jQuery Mobile
Whether jQuery HTML work for both HTML and XML documents?
Name some of the methods of jquery used to provide effects?
What is the purpose of fadetoggle() method in jquery?
What is jQuery?
Explain various methods to make ajax request in jquery? : jquery mobile
Explain various methods to make ajax request in jquery?
What is the difference between jquery.get() and jquery.ajax()?
How to disable jquery animation? : jquery mobile
what is the use of param() method in jquery .