Understanding <a> anchor tag in HTML.

·

2 min read

Table of contents

No heading

No headings in the article.

Today i got assignment from my teacher that you have to research about anchor tag in HTML , the target attribute in tag.

There are four main keyword for target attribute:

  1. _self
  2. _blank
  3. _parent
  4. _top

For understanding about these keywords you have you know about browsing context, so let's discuss about, # Browsing Context =>

Browsing Context is nothing but the window in which you want to open the any link, this can be your new tab , a new window of your browser and can be iframe. This iframe part is very important to understand these keywords.

Let's discuss one by one->

_self => This is the simplest one this opens up a webpage (given a link in tag) in the same browsing context.

_blank => This is also a simple one this opens a new blank tab in your browser and then opens up the link given in tag.

_parent => This keyword is more helpful if you have nested iframes in your HTML this keyword search for parent browsing context and opens up the link. Remember the browsing context ? Discussed above.

_top => This keyword is used in the place where you want to open up the link in topmost browsing context if you have many nested

That's all from my side. -Please correct me if i am wrong at any place i will appreciate that I am in learning phase hope this will be helpful to you also.

Thanks!

Did you find this article valuable?

Support Shubham by becoming a sponsor. Any amount is appreciated!