Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

HTML Introduction to HTML and CSS HTML: The Structural Foundation of Web Pages and Applications Anchor Tags

What is the purpose of underscore in the target attribute before the blank?

In the final parts of a video where we try to create a link that opens a new tab, within the anchor tags after the href, what is the purpose of the underscore after the target attribute. I tried it without the underscore and it works as well.

1 Answer

Steven Parker
Steven Parker
217,443 Points

The keyword "_blank" (with the underscore) always creates a new target window or tab. Anything else (including the word "blank" with no underscore) creates a named target, and unless you already had a target with that name, it would appear to do the same thing. But if you reference it again, it would change the location of the previous window or tab instead of creating another new one.