"trousers, drawers," 1840, see pantaloons. The word was limited to vulgar and commercial use at first.
I leave the broadcloth,—coats and all the rest,—
The dangerous waistcoat, called by cockneys "vest,"
The things named "pants" in certain documents,
A word not made for gentlemen, but "gents";
[Oliver Wendell Holmes, "Urania: A Rhymed Lesson," 1846]
Colloquial singular pant is attested from 1893. To wear the pants "be the dominant member of a household" is by 1931. To do something by the seat of (one's) pants "by human instinct" is from 1942, originally of pilots, perhaps with some notion of being able to sense the condition and situation of the plane by engine vibrations, etc. To be caught with (one's) pants down "discovered in an embarrassing condition" is from 1932.
"man who draws attention by unusual finery of dress and fastidiousness manners, a fop," c. 1780, of uncertain origin; attested earliest in a Scottish border ballad:
I've heard my granny crack
O' sixty twa years back
When there were sic a stock of Dandies O
etc. In that region, Dandy is diminutive of Andrew (as it was in Middle English generally). OED notes that the word was in vogue in London c. 1813-1819. His female counterpart was a dandizette (1821) with French-type ending.
Meaning "anything superlative or fine" is from 1786. As an adjective, "characteristic of a dandy, affectedly neat and trim," by 1813; earlier in the sense of "fine, splendid, first-rate" (1792) and in this sense it was very popular c. 1880-1900.
The popular guess, since at least 1827, is that it is from French Dandin, a mock surname for a foolish person used in 16c. by Rabelais (Perrin Dandin), also by Racine, La Fontaine, and Molière, from dandiner "to walk awkwardly, waddle." Farmer rejects this and derives it from dandyprat, an Elizabethan word for "a dwarf; a page; a young or insignificant person," originally (early 16c.) the name of a small silver coin. Both words are of unknown origin, and OED finds the connection of both to dandy to be "without any apparent ground." English dandy was itself borrowed into French c. 1830.
Jack-a-Dandy, or Jack O'Dandy figures in writings from the early 17c. He is listed among other famous Jacks in "Iack a Lent" (1620) and is sometimes defined as an impertinent little man, but other uses are unclear as to sense and in at least one instance from 1620s he is a bogeyman character.
DANDY was first applied half in admiration half in derision to a fop about the year 1816. John Bee (Slang Dict., 1823) says that Lord Petersham was the chief of these successors to the departed Macaronis, and gives, as their peculiarities, 'French gait, lispings, wrinkled foreheads, killing king's English, wearing immense plaited pantaloons, coat cut away, small waistcoat, cravat and chitterlings immense, hat small, hair frizzled and protruding.' [Farmer and Henley, "Slang and its Analogues," 1891]