The doorknob was invented in 1878 by Osbourn Dorsey when he filed a patent for an internal mechanism that latched doors shut. If Dorsey's knob was on the left side of a door, it unlatched a metal bar on the right side of the door.
The metal rod latched into a hole in the door frame. Homeowners accessed the connection in the frame by unscrewing a small metal cover.
Before doorknobs, homeowners secured doors by using a latch string that looped around a bar to keep strangers out. In ancient times, people raised and lowered bars to secure doors so that people could not get inside.