How to get attribute from a <link tag in pure javascript?

前端 未结 4 558
耶瑟儿~
耶瑟儿~ 2021-02-02 13:18

How can I ge

4条回答
  •  南笙
    南笙 (楼主)
    2021-02-02 13:58

    You could use JQuery:

    var url = $('link[rel=canonical]').attr("href");
    

提交回复
热议问题