Search notes:

HTML element: a

An <a> element with a href attribute represents a hyperlink.

Attributes specific to the <a> tag

Besides the global attributes, the <a> element has these specific attributes:

Removing underlines

The underlines of an <a> element can be removed by setting the CSS attribut text-decoration to none:
<style>
a {
  text-decoration: none;
}
</style>
…
<a href='xyz.html'>xyz</a>

Calling a JavaScript function when clicking the element

There are essentially two ways to call a JavaScript function by clicking on a <a> element:
<a href='javascript:alert("hello world")'>Click me</a>
<a href='#' onclick='alert("good by"); return false;'>follow me</a>

Misc

In the HTML DOM API, the <a> element is, inconsistently, represented by an HTMLAnchorElement (not an HTMLAElement).
HTMLLinkElement is the DOM interface for the <link> element.
See also HTMLElement inheritance).

See also

document.links
«Invisible» links can be formulated with the <link> element.
The CSS pseudo selector :target selects the currently clicked target (attribute id) HTML element.
HTML elements

Index