1590s, intransitive, "hang loosely, be suspended so as to sway in the wind," probably from Scandinavian (compare Danish dangle, Swedish dangla "to swing about," Norwegian dangla), perhaps via North Frisian dangeln. Transitive sense of "carry suspended so as to swing or sway" is from 1610s. Related: Dangled; dangling.
"penis," 1891, slang, of unknown origin. Perhaps suggested by dingus and other names for unnameable things; perhaps suggesting of a sound of striking (clapper of a bell?); perhaps there's an element of donkey in it.
<a href="https://www.etymonline.com/word/dongle">Etymology of dongle by etymonline</a>
Harper, D. (n.d.). Etymology of dongle. Online Etymology Dictionary. Retrieved $(datetime), from https://www.etymonline.com/word/dongle