In HTML, an ID attribute appears inside an opening tag for an element on the page and gives a unique name to the element for use when referencing it in code or script. Both the ID attribute and the NAME attribute perform this function. In Visual Basic Internet applications, elements on a page are required to have IDs or names.