"joint between the principal bones of the leg," Old English cneo, cneow "knee," from Proto-Germanic *knewa- (source also of Old Norse kne, Old Saxon kneo, Old Frisian kni, Middle Dutch cnie, Dutch knie, Old High German kniu, German Knie, Gothic kniu), from PIE root *genu- (1) "knee; angle." For pronunciation, see kn-.
To be across (someone's) knee in reference to spanking is from 1866. Knee-breeches is from 1827; knee-pants is from 1858. Knee-slapper "funny joke" is from 1955.
1550s, "stroke of a whip," from jerk (v.1). Sense of "sudden sharp pull or twist" is by 1570s. Meaning "involuntary spasmodic movement of limbs or features" recorded from 1805. As the name of a popular dance, it is attested from 1966.
<a href="https://www.etymonline.com/word/knee-jerk">Etymology of knee-jerk by etymonline</a>
Harper, D. (n.d.). Etymology of knee-jerk. Online Etymology Dictionary. Retrieved $(datetime), from https://www.etymonline.com/word/knee-jerk