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 are the features of jQuery, has been used in web applications?
Whether jQuery HTML work for both HTML and XML documents?
How We Can Write Code Specific To Browser In Jquery?
What are the types of selectors that are used in jquery? Give examples.
How to get the direct parent of an element using ?
How to use migrate jquery plugin if possible? : jquery mobile
Explain the basic need to start with jquery? : jquery mobile
How to check data type of any variable in jquery? : jquery mobile
Why are not some scripts and styles loading? : jquery mobile
How we can set the html contents of an element in jquery?
Explain the difference between .empty() and .remove() ?
How do I pull a native DOM element from a jQuery object?
How to work with jQuery parent(), children() and siblings()?
what is the use of param() method in jquery .
Difference between document.ready() and body onload()?