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 |
Can we select a element having a specific class in jquery ?
List browser related issues for jquery?
What is method chaining in jquery and what are the advantages?
What is the use of jquery.data()?
Define url paremeter of jquery ajax method?
What is jquery mobile theming? : jquery mobile
explain width() vs css(‘width’) in jquery
Write the code to define a requirejs module with its dependencies.
What is the difference between prop() and attr() in jquery?
What features of jquery, has been used in web applications?
What are jquery plugins?
Is there any difference between body onload() and document.ready() function?