Html Target Attribute not supported

前端 未结 7 1116
一个人的身影
一个人的身影 2021-02-19 05:23

I was just on w3Schools looking at target and found that it is no longer supported by any of the major browsers. A brief google search did not reveal the reason for this? Should

7条回答
  •  谎友^
    谎友^ (楼主)
    2021-02-19 06:17

    It is supported by most major browsers. It's just not part of the strict HTML specifications from the W3C. However, browsers implement it even when using a strict doctype. This fact is sometimes used to emulate its behaviour with JavaScript while keeping HTML that still validates:

        This is an external link
    

    And:

    var links = document.getElementsByTagName('a');
    for(var i=0, len=links.length; i

    In transitional doctypes, no workaround is required.

提交回复
热议问题