Created
October 3, 2018 13:03
-
-
Save shuyuhey/4ee73b3ac3cc7f405e7596d674e94b39 to your computer and use it in GitHub Desktop.
metaタグをnameで取得したいときに使う
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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