Cache HTMLCollection length.