Keep the DOM in certain variable instead querying it each time you need it.