devxlogo

BASE TARGET for all a HREF documents in frame

BASE TARGET for all a HREF documents in frame

Question:
I want all documents that I open from a child frame to be “target=_top”, but I don’t want to add “Target=” to every HREF tag. Is there a way I can set a base target?

Answer:
Yup. At the top of the page use:

<base target="_top">If you use a different target in any of the links on that page, it willoverride the base target.
devxblackblue

About Our Editorial Process

At DevX, we’re dedicated to tech entrepreneurship. Our team closely follows industry shifts, new products, AI breakthroughs, technology trends, and funding announcements. Articles undergo thorough editing to ensure accuracy and clarity, reflecting DevX’s style and supporting entrepreneurs in the tech sphere.

See our full editorial policy.

About Our Journalist