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 |
What is the method used to define the specific character in place of $ sign?
Can we call c# codebehind method using jquery?
How do you get the attribute of an html tag in jquery?
How we can modify the css class in jquery?
Explain which program is useful for testing jquery?
Difference between parent() and parents() in jQuery?
What is the difference between jquery-x.x.x.js and jquery.x.x.x min.js?
What is each() function in jQuery? How do you use it?
Can you use any other name in place of $ (dollar sign) in jQuery?
How to get/set the html contents of an element using jQuery?
How to find all sibling elements after the current element using ?
Which is the starting point of code execution in jQuery?