I tend to do this by default, even for ids, because it lets you set the handler without having to set a ready callback first in case the element hasn't loaded yet.

(Which almost is never an issue anyway since this JS goes at the bottom of the page but y'know whatevs)