Generalized code for initializing selectable attributes.