Explain use of NAME and HREF attributes of the A tag.

Q5. Explain the use of the NAME and HREF attributes of the <A> tag.
Ans. The NAME attribute defines a name of a section/ segment in a document. For example:
<A name=”segment1”> segment1</A>

The HREF attribute defines the URL of the target segment/ location/ page. For example:
<A HREF=”#segment1”> Link to Segment1</A>
<A HREF=http://www.plant.com> Plants</A>

2 thoughts on “Explain use of NAME and HREF attributes of the A tag.”

  1. That’s the awesome site aand its very helpful dear …………thnks for giving information about HREF

Leave a Reply

Your email address will not be published. Required fields are marked *