Obtenha o valor da meta tag do URL JavaScript
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'));