Answers for "show tag name in jquery"

2

jquery tag name

$('anything').prop("tagName")
Posted by: Guest on March-10-2020
0

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'));
Posted by: Guest on April-23-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language