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 all the ways to include jQuery in a page?
Do you know what is the use of jquery.data()?
How to search for descendant elements that match the specified selectors using ?
Can you please explain the difference between body onload() and document.ready() function? : jquery mobile
How do you select all elements with the class of “selected” in jquery?
What are selectors in jquery? Explain
How did you become the creator of jquery ui? Whats the story behind that?
Is jQuery is a JavaScript or JSON library file?
Can you use any other name in place of $ (dollar sign) in jQuery?
Explain jquery $.ajax() method?
What is the difference between settimeout() and setinterval() methods?
What is the difference between the knockout and jquery?
Explain all the ways to include jquery in a page?
Which one is more efficient, document.getElementbyId( "myId") or $("#myId)?
How can we include jQuery library in ASP.Net project?