Ticket #7590 (closed enhancement: wontfix)
jQuery.fn.css returns computed styles on the first DOM node or no-ops
|Reported by:||danbeam||Owned by:|
Hello fellow jQuery developers,
While I was mucking around in jQuery's source (here: https://github.com/jquery/jquery/blob/master/src/css.js#L17), I noticed that calling jQuery.fn.css with no arguments wasn't one of the cases planned for in this function. I additionally checked the documentation ( http://api.jquery.com/css/) and found no cases of calling jQuery.fn.css() without a propertyName or value/object to set styles of a node/set of nodes.
So, I thought it would be cool if jQuery.fn.css() would return all computed styles on the first HTMLElement in a set (if there is one), otherwise no-op, as calling something like $('body').css() seemed to be throwing errors anyways (TypeError: Cannot call method 'replace' of undefined).