Guys I\'ve been asking around and nobody can really tell me the benefits of using .css(‘width’) and .css(‘height’) rather than .width()
.css(‘width’)
.css(‘height’)
.width()
var elH = someElement.height(); // 200
.height() returns a Number, while
.height()
var elH = someElement.css("height"); // "200px"
above jQuery accesses the element's style property like JS would in:
style
var height = someDOMelement.style.height; // "200px"
returning a String value in px.
px