The answer to the riddle "what is bought by the yard and worn by the foot?" is carpet. This riddle is commonly found on various websites.