Skip to content

Instantly share code, notes, and snippets.

@shuyuhey
Created October 3, 2018 13:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shuyuhey/4ee73b3ac3cc7f405e7596d674e94b39 to your computer and use it in GitHub Desktop.
Save shuyuhey/4ee73b3ac3cc7f405e7596d674e94b39 to your computer and use it in GitHub Desktop.
metaタグをnameで取得したいときに使う
const meta = name => {
const metas = document.head.children;
return Array.prototype.slice.call(metas).find(element => name === element.getAttribute('name'))
};
export default meta;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment