Is it okay to add id/class to <link> tag?

前端 未结 4 454
孤独总比滥情好
孤独总比滥情好 2020-12-05 06:41

Is it okay to do this?


so I can use JavaScript to d

4条回答
  •  有刺的猬
    2020-12-05 07:31

    Yes. There are certain attributes that may be specified on every html element. id and class are among them.

    For a complete list in the html5 spec: http://developers.whatwg.org/elements.html#global-attributes

    The spec for the link element: http://developers.whatwg.org/semantics.html#the-link-element

    And in html4.1: http://www.w3.org/TR/html401/struct/links.html#h-12.3

提交回复
热议问题