Francis Bellamy wrote the Pledge of Allegiance in 1892.
A lot of people (read me) don't know it came with a salute, also from Bellamy,
to be used while saying the pledge.
I know, I know, it looks strange now, but that's because thirty-odd years later
Benito started to use it as a Roman Salute, followed by Adolf's Nazi Salute.
When WW II (the big one) came along pictures of American kids that didn't show
the flag too, were open to misinterpretation.
So FDR said we can't have that, and changed it to the hand over heart salute we're familiar with.
Congress made it law at the end of 1942.
link
link