Wednesday, 17 July 2013

multiple CSS properties select in jquery

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

Q)  multiple CSS properties in single statement

Q)  Select multiple CSS properties in jquery

 
Answers :   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 Collection = $("#login").css([ "width", "height", "backgroundColor" ]);

Collection will be an array and it will look something like this

{ 
  width: "100px", 
  height: "200px", 
  backgroundColor: "#FF00FF" 
}

No comments:

Post a Comment