Use bungee cords to keep items from tumbling off freestanding shelves. The cords are especially helpful in high-traffic areas, such as the garage, where shelves might get jostled. Hook a cord across the front of a shelf, or use an extra-long one to wrap around the sides as well. If the cord isn't taut, wrap slack around the leg, then hook the cord to itself.
Supply-Securing Cord
Martha Stewart Living, August 2006

Just remember these cord can break. Be sure to use new cords.