Generates references based on DOM elements