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 param() method?
What is resize() function in jquery?
Can you please explain the difference between parent() and parents() methods in jquery? : jquery mobile
Can we call c# codebehind method using jquery?
What is the jQuery code to select all links inside the paragraph?
Have any of your startup projects failed dismally - if so, why and how did you learn from them?
What is a filter in jquery? Explain
Explain various methods to make ajax request in jquery? : jquery mobile
Why jquery?
Which is the fastest selector in jQuery?
Why should I use jquery?
Change the url for a hyperlink using jquery?
How to multiple AJAX requests be run simultaneously in jQuery?
What is CDN?
Tell me how to select combobox select value and text using jquery?