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 |
Is there any advantage of using $.ajax() for ajax call against $.get() or $.post()?
How to get the current offset of the first matched element, in pixels, relative to the document using ?
Mention some advantages of jquery.
What is the difference between jquery's ready and holdready?
Explain some features of jquery knockout?
What is jQuery CDN?
Explain type paremeter of jquery ajax method?
How we can get the input value of an element using jquery?
How can events be prevented from stopping to work after an ajax request?
What methods used to provide effects?
Which are the fastest selectors in jquery? : jquery mobile
Why we need jquery mobile? : jquery mobile