js get meta-tag name
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'));
Also in JavaScript:
- react native componentwillmount vs componentdidmount
- offset in js
- node js type error
- javascript select audio device
- react promises
- const { message }
- bullmq
- core.js:6228 ERROR TypeError: Cannot read property 'image' of undefined
- send data from form to another page angular
- c# print object to json
- count the number of spacesinto a string javascript
- javascript select2 sortable
- jquery datepicker set year range
- const in javascript
- react native add custom fonts
- How to Use the JavaScript Fetch API to Get Data
- javascript string includes substring
- how to store textbox data while typing for chrome extension
- javascript remove last character of string
- SFC in react
- eslint disable react
- flatlist footer react native
- what is a 0 based language
- remove last comma from string javascript