Uzyskaj wartość metataga z JavaScript URL
document.getElementsByTagName("meta").generator.getAttribute('version');
Hurt Hamster
document.getElementsByTagName("meta").generator.getAttribute('version');
function getMeta(metaName) {
const metas = document.getElementsByTagName('meta');
for (let i = 0; i < metas.length; i++) {
if (metas[i].getAttribute('name') === metaName) {
return metas[i].getAttribute('content');
}
}
return '';
}
console.log(getMeta('video'));