Trip the Light Fantastic

What is the origin and/or derivation of the expression
"Come Trip the Light Fantastic " as it applies to dancing.

Take your pick of the following:

"L'Allegro"
by John Milton, 1645

And love to live in dimple sleek;
Sport that wrinkled Care derides,
And Laughter holding both his sides.
Come, and trip it as you go
On the light fantastic toe;
And in thy right hand lead with thee
The mountain nymph, sweet Liberty;

"Sidewalks of New York"

Boys and girls together,
Me and Mamie O'Rourke,
Tripped the light fantastic,
On the sidewalks of New York.