Is it possible to get value of multiple CSS properties in single statement?



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

Post New Answer

More jQuery Interview Questions

What is the method used to define the specific character in place of $ sign?

0 Answers  


Can we call c# codebehind method using jquery?

0 Answers  


How do you get the attribute of an html tag in jquery?

0 Answers  


How we can modify the css class in jquery?

0 Answers  


Explain which program is useful for testing jquery?

0 Answers  






Difference between parent() and parents() in jQuery?

0 Answers  


What is the difference between jquery-x.x.x.js and jquery.x.x.x min.js?

0 Answers  


What is each() function in jQuery? How do you use it?

0 Answers  


Can you use any other name in place of $ (dollar sign) in jQuery?

0 Answers  


How to get/set the html contents of an element using jQuery?

0 Answers  


How to find all sibling elements after the current element using ?

0 Answers  


Which is the starting point of code execution in jQuery?

1 Answers  


Categories