Is it possible to get value of multiple CSS properties in single statement?
Submitted by: AdministratorWell, 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"
}
Submitted by:
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"
}
Submitted by:
Read Online JQuery Programmer Job Interview Questions And Answers
Top JQuery Programmer Questions
☺ | What are jQuery Selectors? Give some examples? |
☺ | How to get the direct parent of an element using jQuery? |
☺ | How to set the style property of an element using jQuery? |
☺ | How to get the height of an element using jQuery? |
☺ | Explain the common methods of sending a request to a server? |
Top Scripting language Categories
☺ | AngularJS Interview Questions. |
☺ | Ext-JS Interview Questions. |
☺ | Dojo Interview Questions. |
☺ | Expert Developer JavaScript Interview Questions. |
☺ | jQuery Mobile Interview Questions. |