Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
Dervin Buckery
Courses Plus Student 838 PointsIn the code line "<a href="javascript:peelOut();"><img src="images/nos.png" alt="nos"></a>" what are the <a></a> for?
Question about <a> ........ </a> .. Is there a specific reason for using the "a" inclosed or can I use any letter/word of my choice?
1 Answer
Steven Parker
243,228 PointsThe "a" tag identifies an anchor element, which is commonly used to create hyperlinks or clickable actions when combined with the "href" property. In this example, the "href" is a JavaScript function named "peelOut", which will be executed whenever the image contained inside the anchor element is clicked.
The choice of letter or word to begin a tag is not arbitrary, it must identify a particular type of element that you want created on the page. A list of possible element types with descriptions of their purpose can be found on this MDN documentation page.