❮ HTML <a> tag
Example
The href attribute specifies the link's destination:
<a href="https://www.w3schools.com">Visit W3Schools</a>
Try it Yourself »
More "Try it Yourself" examples below.
Definition and Usage
The href
attribute specifies the URL of the page the link goes to.
If the href
attribute is not present, the <a>
tag will not be a hyperlink.
Tip: You can use href="#top"
or href="#"
to link to the top of the current page!
Browser Support
Attribute | | | | | |
href | Yes | Yes | Yes | Yes | Yes |
Syntax
Attribute Values
Value | Description |
URL | The URL of the link. Possible values: - An absolute URL - points to another web site (like href="http://www.example.com/default.htm")
- A relative URL - points to a file within a web site (like href="default.htm")
- Link to an element with a specified id within the page (like href="#section2")
- Other protocols (like https://, ftp://, mailto:, file:, etc..)
- A script (like href="javascript:alert('Hello');")
|
More Examples
Example
How to use an image as a link:
<a href="https://www.w3schools.com">
<img border="0" alt="W3Schools" src="logo_w3s.gif" width="100" height="100">
</a>
Try it Yourself »
Example
How to link to an email address:
<a href="mailto:someone@example.com">Send email</a>
Try it Yourself »
Example
How to link to a phone number:
<a href="tel:+4733378901">+47 333 78 901</a>
Try it Yourself »
Example
How to link to another section on the same page:
<a href="#section2">Go to Section 2</a>
Try it Yourself »
Example
How to link to a JavaScript:
<a href="javascript:alert('Hello World!');">Execute JavaScript</a>
Try it Yourself »
❮ HTML <a> tag
W3schools Pathfinder
Track your progress - it's free!
FAQs
There is a LOT of working constantly happening in the worlds of HTML, CSS, and JavaScript, and if a resource doesn't keep up, it is a detriment to the programming world, not a benefit. Using W3Schools to learn something is a waste of time, some topics are outdated and it lacks the rigor that you'll find on MDN.
Is W3Schools good enough? ›
W3schools is good for a quick reference point if you're in the middle of coding something and want to find out a specific function or whatever. If you want to learn advanced code I would avoid W3schools however w3schools is a good free resource for the average programmer.
Is W3Schools certification legit? ›
W3Schools is Trusted by Top Companies
Our certificates are recognized and valued by companies looking to employ skilled developers.
Is W3Schools a reliable source? ›
Their ... | Hacker News. Nobody denies that W3Schools is a terrible place to learn how to program. Their examples are outdated, insecure, and don't really explain why things work in a certain way.
Which is better W3Schools or codecademy? ›
Of the two, Codecademy has a simpler structure. You can easily find the topic you want and start learning. Its fixed pricing plans are also easier to understand. In addition, the biggest issue with W3Schools is the ads that keep popping up as you learn.
Who is behind W3Schools? ›
It is run by Refsnes Data in Norway. It has an online text editor called TryIt Editor, and readers can edit examples and run the code in a test environment.
Can I get a job with W3Schools certificate? ›
Becoming certified by W3Schools is great proof to show to employers and makes your resume stand out among other candidates.
How does w3school make money? ›
Through ads : through ads alone they will earn alot in w3schools. They would earn nearly 1–2lacks per day in ads alone. Through donation:. Many people who completed their courses in w3schools, after few years , they would donate some money for the growth of the site .
Is W3Schools bootcamp worth it? ›
The W3C Bootcamp is an excellent program that far exceeded my expectations. Its contemporary syllabus, engaging learning environment, and practical approach make it an invaluable resource for anyone seeking to understand web development.
Is sololearn better than W3Schools? ›
Neither are necessarily better than the other because they both show their curriculum in different ways. I think Sololearn is better for experimentation and First-time learning while w3 schools is better for reference.
Basically the title. Not only Select Star SQL misses many basic SQL operations, but its explanations are both unnecessarily complicated and miss lots of details.
Is W3Schools completely free? ›
Both My Learning and W3Schools Public Profile are completely free of charge, however there are available upgrade plans that can enhance your learning experience. Where can I find My Learning? You can access your My Learning profile through the upper right corner on any W3Schools page.
Is W3Schools good now? ›
w3schools is a great website, and does it's purpose. BUT it's purpose isn't to teach you how to code (as can be falsely understood from it's name), but to provide a complete “dictionary” for web developing languages such as HTML, CSS, JavaScript and others.
Can you learn from W3Schools? ›
We create simplified and interactive learning experiences. Learning web development should be easy to understand and available for everyone, everywhere! W3Schools is a school for web developers, covering all the aspects of web development: HTML Tutorial.
How popular is W3Schools? ›
The Most Popular Browsers
W3Schools has over 60 million monthly visits.
Is W3Schools good for kids? ›
Who can use W3Schools? W3Schools is accessible to everyone, from beginners to more experienced developers. It serves as a valuable resource for both groups, often used as a reference tool. It is particularly suitable for middle and high school students, aligning well with their educational needs and curriculums.
Is W3Schools popular? ›
W3schools is a great resource for looking up how to write a specific piece of code, but it doesn't have the flow or continuity that the other courses do.
Is W3Schools a good place to learn SQL? ›
"Perfect e-learning course for beginners. The training is very well structured together with quizes after almost every lesson. Great job!
Are there any websites like W3Schools? ›
stack overflow is the largest, most trusted online community for developers to learn, share their programming knowledge, and build their careers. learn to code in python, c/c++, java, and other popular programming languages with our easy to follow tutorials, examples, online compiler and references.