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.
As mentioned, href requests a resource such as a webpage, a form handler, a block quote reference page, or a style sheet. In many cases (save for style sheets) the link will open a new webpage, from which the back button should return us to the previous page.
src indicates a resource that is embedded in the current document, such as, img, video, audio, or script. The browser will allocate screen real estate depending upon the physical dimensions of the embedded object. href has no such provision.
where the HT stands for HyperText, so what we have is a HyperTextReference, or href.
Anchors are bound to what they hook onto, hence the name given to navigation (site or external) links, <a>, where ‘a’ stands for anchor. We can take this into consideration and give href another name that extends the vernacular… hook reference. This is slang. Nonetheless, a valid alias for hypertext reference.