Creating elements on the fly
Is there a jQuery equivalent for the traditional:
- 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:
- $(document).ready(function() {
- $('head').add('link').attr('type', 'text/css', 'href', 'script/fancybox/jquery.fancybox-1.3.1.css', 'media', 'screen');
- })
But the element will not get added, I presume it's meant to go before the ending '</head>' tag?