The SitePoint Forums have moved.

You can now find them here.
This forum is now closed to new posts, but you can browse existing content.
You can find out more information about the move and how to open a new account (if necessary) here.
If you get stuck you can get support by emailing forums@sitepoint.com

If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

What would the browser do with such information? The only thing that is similar to what you are describing is microformats.

The browser doesn't add anything to HTML elements. Browsers do add certain properties and methods to HTML element objects that are sometimes standards-based and other times not. For example, Internet Explorer has the currentStyle property that no other browser implements.

However, you're not being terribly clear about what it is you're after.

Well, if there's no id, the element can potentially be obtained through its relations to other elements. Your HTML document is basically a tree in structure, well, an upside down tree to be exact.

It starts at the root, and expands into different branches (nodes). Each branch can have other branches growing from it, on and on. There's a few types of relations: parent, child, sibling.

In the case of parent, it would be say, the branch that a branch is growing from, or in an actual html document:

<div><ul></ul></div>

The ul would have the div for the parent. In the case of a child, it would be branches growing from the current branch, or in the case of the above, the ul would be a child of the div tag. For a sibling, it would be branches that grow from the same branch that the current one is growing from. So to expand the previous example:

<div><h1></h1><ul></ul></div>

The ul and h1 tags are both siblings, as they share the same parent (the div). So if we had a document like so:

<html><body><div><h1></h1><ul></ul></div></body></html>

We don't have an id to grab the ul right away, but we can traverse down using relationships to find it:

document.body.firstChild.firstChild.nextSibling;

so we start at the document's body, get the first element that is a child of the body (the div), get the first element that is a child of the div (the h1), then get the next element that is a sibling of the h1 (ie. it shares the same parent, being the div), which results in us getting the ul element.

Another way you can find an element is through getElementsByTagName. This retrieves a list of tags, then you can go through each tag and look for a certain attribute that makes it stand out, such as a css class, or a style of some sort.