What's the difference between src and href in html? | Sololearn: Learn to code for FREE!
¡Nuevo curso! ¡Todo programador debería aprender IA Generativa!
Prueba una lección gratuita
+ 2

What's the difference between src and href in html?

17th Aug 2020, 7:57 AM
Nishchal B A
Nishchal B A - avatar
3 Respuestas
0
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. Source: https://discuss.codecademy.com/t/whats-the-difference-between-href-and-src-attributes/353244#:~:text=Answer,)%20and%20tags.
17th Aug 2020, 9:19 AM
Junaire Edris Buico
Junaire Edris Buico - avatar
0
src : To specify the origin of (a communication). href: A reference or link to another page, document.
4th May 2022, 5:21 AM
Aman Srivastava
Aman Srivastava - avatar