What's the difference between href and src attributes?


#1

Question

What’s the difference between href and src attributes?

Answer

The href attribute specifies the location (URL) of a resource, that an anchor element points to, or the location of a linked resource, like a stylesheet. While the src attribute is used to embed a resource - usually URLs - into a document, think embedded images (<img>) and <script> tags.