Creating elements on the fly

Creating elements on the fly

Is there a jQuery equivalent for the traditional:
  1. document.createElement('span')
Because I'm trying to attach a stylesheet using jQuery. So far all I've found is the add() method, so I've put this together:

  1. $(document).ready(function() {
  2.     $('head').add('link').attr('type', 'text/css', 'href', 'script/fancybox/jquery.fancybox-1.3.1.css', 'media', 'screen');
  3. })
But the element will not get added, I presume it's meant to go before the ending '</head>' tag?