Jquery allows us to use the $.css() method directly and pass the raw DOM element as the first parameter. For example, if I want to set 'a' to the width of myDiv, jQuery allows this syntax:
(OPTION 1):
var elem = document.getElementById('myDiv');
var a = $.css(elem, 'width');
instead of this (OPTION 2):
var a = $('#myDiv').css('width');
Option 1 does not require a selector, and it appears to rely on the global jQuery object instead of creating a new one. I can't find any documentation in the jQuery API or online about this method. I assume this would be a performance increase, especially when jQuery objects are required in animations. Any reason why I shouldn't be using this method?
Thanks!
EDIT: Perf tests show that option 1 is a bit faster. Doesn't seem like there's any reason not to use $.css() directly. Thanks to all for the answers!