Accessing DOM elements with JavaScript is slow so in order to have a more responsive page, you should:
For more information check the YUI theatre's "High Performance Ajax Applications" by Julien Lecomte.