Definition
To suddenly and impulsively decide to do something, often something unexpected or foolish.
She took it into her head to quit her job and travel.
He took it into his head yesterday to dye his hair pink.
The children took it into their heads to dance in the rain.