JQuery Programmer Question: Download Questions PDF
Is it possible to get value of multiple CSS properties in single statement?
![JQuery Programmer Interview Answer JQuery Programmer Interview Question](https://globalguideline.com/public/images/interview/23.png)
Answer:
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.
var propCollection = $("#dvBox").css([ "width", "height", "backgroundColor" ]);
In this case, the propCollection will be an array and it will look something like this.
{
width: "100px",
height: "200px",
backgroundColor: "#FF00FF"
}
var propCollection = $("#dvBox").css([ "width", "height", "backgroundColor" ]);
In this case, the propCollection will be an array and it will look something like this.
{
width: "100px",
height: "200px",
backgroundColor: "#FF00FF"
}
Download JQuery Programmer Interview Questions And Answers
PDF
Previous Question | Next Question |
What is the difference between calling stop(true,true) and finish method? | Why is the block display style used for animations? |