Lanyards are also those things that Boy Scouts (and occasionally people, teenager and younger, of either gender) make for fastening things ranging from cups and utensils to keychains.
In their basic form, lanyards consist of two pieces of stretchy plastic that are flat, thin, about 2.5 millimeters in width and about a meter long, although the finished lanyard is usually about ten centimeters long and a bit less than a centimeter thick and wide. Typically they"re of contrasting colors (I prefer making mine out of glow-in-the dark green and black, so it can double as a light at night by which to read), with a hook at one end to clip to a zipper or whatever and possibly a hook at the other end as well.
The simplest lanyard is the square lanyard which is one color on two opposing sides and the other color on the other opposing sides. There are also circle and spiral lanyards, which have helix-like spirals of colors going along the side. Spiral lanyards and other more complex lanyards require more than two strands, however.
Legend says that lanyards were invented by adult leaders for Scouts in the 1930s using thin leather straps vertically weaved for which to hang various supplies (such as cups, torches, etc.) from belt loops, although I had significant difficulty verifying these claims.
Kawika says Hi there! I thought of creating a new writeup for lanyard, but I figured it's just easier for you to add the information to yours. Lanyards of the type you talk about were invented before the Boy Scouts: Cavalry officers used them to secure their guns. If the gun fell out of their grip, they could just run their hand down the lanyard to scoop it back up again (Very useful while on horseback). The dress uniform of the RCMP still has a lanyard, for example.