Which is more efficient please?
var myElement = $(\"#the-name-of-my-element\")
myElement.doSomethingOnce;
myElement.doSomethingTwice;
...
myElement.doSometh
It is always good practice to cache your nodes. The amount of work the JS engine has to do to locate the nodes is more expensive than the memory that you will use storing the node (of course unless you are storing a massive DOM tree or something).
So the winner is:
var myElement = $("#the-name-of-my-element")
myElement.doSomethingOnce;
myElement.doSomethingTwice;
...
myElement.doSomethingTenTimes;