I have a problem that needs quick solution

How to add a target attribute with the value _blank to the anchor (a ) element’s opening tag, so that the link opens in a new tab.

Hey. Here.

Thanks for the answer but it is not clear yet sir

That’s all I can offer, mate. It’s well explained here. With a perfect example.

A target attribute with the value of “_blank” opens the linked document in a new window or tab.

	<a href="https://www.freecodecamp.org" target="_blank">freeCodeCamp</a>

Welcome to the community.

A target attribute and its value “_blank” are entered the same as any other attribute and value. I think the confusing part for everyone is the value “_blank”. But, if it is thought of as
<input type="submit" class ="open">
The input element is like the a anchor element, type attribute is like the target attribute and the "submit" value is the like the “_blank” value.

I hope this helps understand a bit more.

Happy coding!

2 Likes


it is not working

Check how you’ve structured your target attribute. You lack some equal signs.

1 Like

Thanks Sir , i will like to learn from you ,lolz I don’t know if you will allow that.

Try moving the target"_blank" attribute around the spaces in the anchors

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.