I'm creating a system where I need to write many DOM elements into variables.
Is there any difference in memory consumption in writing HTML elements vs. jQuery objects?
HTML elements:
var elemento = jQuery('#elemento')[0]; //mesmo que document.getElementById('elemento')
jQuery object:
var elemento = jQuery('#elemento');
In my lay vision, I think the first option would consume less memory by just writing the DOM element, and in the second is generated a new jQuery object that carries inside that element.
Proceed?