[英]What is the best way to get a Meta Element's Attribute Value in JS?
Something like this: 像这样:
this.token = document.getElementById("token").getAttribute("content");
Even better, get the meta element by Name
更好的是, by Name
获取meta元素
尝试这个:
document.querySelector('meta[name="name"]').getAttribute("content");
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.