I have a question.
Let's say we have the following html tag:
<div id='foo'>I am a div</div>
var d = $("#foo")
The fastest way is:
Setting this to a variable for reuse will prevent the need to find it over and over again, so yes that is the way to go.
if you want to make a jQuery object out of it:
var fooDiv = document.getElementById("demo"); var $fooDiv = $(fooDiv);