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 |
How to load jQuery locally when CDN fails?
Tell me how to check data type of any variable in jquery? : jquery mobile
What does $("div") will select?
How does jquery mobile theming work? : jquery mobile
What does dollar sign ($) me in jquery?
What is the purpose of fadetoggle() method in jquery?
How can we add change font size using jquery?
In jquery, what is the meaning of toggle?
In what scenarios jQuery can be used?
Difference between document.ready() and body onload()?
Explain various methods to make ajax request in jquery?
What is the difference between calling stop(true,true) and finish method?