What target="_parent | _top" does in anchor tag?
<a href="somepage.html" target="_parent">link</a>
I didn't find any example for it. It would be great if someone could give real example of this attribute. I've checked various resources including stackoverflow
Are these attribute values deprecated, if not how could we use them now? I'm confused because articles regarding these attribute value only say what it does. but don't give example.
A target=\"_top\" attribute specifies that the the linked page or form response will be opened in the topmost frame. The topmost frame is the full browser tab and window.
A target="_parent" attribute value specifies that the target page will be opened in a parent frame. The target page can be a linked page or a response to a form submission.
_parent: It opens the linked document in the parent frameset. _top: It opens the linked document in the full body of the window.
_parent. Opens the linked document in the parent frame.
target="_self" This opens an anchor in the same frame. What is confusing is that because we generally don't write in frames anymore (and the frame and frameset tags are obsolete in HTML5) people assume this a same window function. Instead if this anchor was nested in frames it would open in a sandbox mode of sorts, meaning only in that frame.
target="_parent" Will open the in the next level up of a frame if they were nested to inside one another
target="_top" This breaks outside of all the frames it is nested in and opens the link as top document in the browser window.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With