Below is the flash demonstration of how particular notes are chosen to be members of a scale (in this case the scale of E) over two octaves to demonstrate how things repeat after the 12th fret.

Intermediate