She dropped her handkerchief on purpose to get his attention.

Literal

She [topic-は] his [genitive-の] attention [object-を] draw [in-order-to-ために] on-purpose handkerchief [object-を] dropped.

An old-fashioned, almost cinematic image — dropping a handkerchief to attract attention is a 19th-century courtship cliché preserved in language. 注意をひく ('draw attention,' literally 'pull attention') is a set phrase. ~ために here marks purpose ('in order to') — distinct from the 'because of' causal use of ~ために that's a separate tag. わざと ('on purpose, deliberately') flags the action as intentional, often with mischievous or strategic overtones. ハンカチ is a contracted English loanword (full form ハンカチーフ).