take it into your head to do somethingtake it into (your) head (to do something)
to decide to do something, often something that seems silly or surprising.
He's taken it into his head to become really jealous.
take it into (one's) head (to do something)
To decide or become set on the idea to do something, often something capricious. Jane has taken it into her head to become a glassblower, and she's already ordered all the tools.
take it into your head to do something
decide impetuously to do something.
1991BenOkriThe Famished Road Fearing that the supervisor might notice me as well and take it into his head to order me to break my neck carrying cement bags, I hurried on.
take it into your head to do something
suddenly decide to do something: She’s taken it into her head to give all her books away.