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 effects methods used in jquery?
What is a jquery ajax?
Why are not some scripts and styles loading? : jquery mobile
Explain cdn in jquery?
With jquery ui 1.7 being released in the last few days, what do you see as the key parts of jquery ui 1.7? What are you most proud of out of that release?
Jquery can be used in what scenarios?
How do you check or uncheck a checkbox input or radio button?
What is queue() in jquery? Use of queue() in jquery?
Explain remove class jquery with example?
Define cache paremeter of jquery ajax method?
How to always reference latest version of jquery?
Explain chaining in jquery? : jquery mobile
Can you please explain the difference between body onload() and document.ready() function? : jquery mobile
How to set attributes of an element using jquery?
How to redirect to another page using jquery?