Tutorial by Examples

This is the basic use of the <a> (anchor element) element: <a href="http://example.com/">Link to example.com</a> It creates a hyperlink, to the URL http://example.com/ as specified by the href (hypertext reference) attribute, with the anchor text "Link to example...
<a href="example.com" target="_blank">Text Here</a> The target attribute specifies where to open the link. By setting it to _blank, you tell the browser to open it in a new tab or window (per user preference). SECURITY VULNERABILITY WARNING! Using target="...
Anchors can be used to jump to specific tags on an HTML page. The <a> tag can point to any element that has an id attribute. To learn more about IDs, visit the documentation about Classes and IDs. Anchors are mostly used to jump to a subsection of a page and are used in conjunction with header...
Simply use the javascript: protocol to run the text as JavaScript instead of opening it as a normal link: <a href="javascript:myFunction();">Run Code</a> You can also achieve the same thing using the onclick attribute: <a href="#" onclick="myFunction(); r...
You can use a relative path to link to pages on the same website. <a href="/example">Text Here</a> The above example would go to the file example at the root directory (/) of the server. If this link was on http://example.com, the following two links would bring the user...
Basic usage If the value of the href-attribute begins with mailto: it will try to open an email client on click: <a href="mailto:[email protected]">Send email</a> This will put the email address [email protected] as the recipient for the newly created email. Cc and ...
If the value of the href-attribute begins with tel:, your device will dial the number when you click it. This works on mobile devices or on computers/tablets running software – like Skype or FaceTime – that can make phone calls. <a href="tel:11234567890">Call us</a> Most de...

Page 1 of 1