javascript get meta description

document.querySelector('meta[name="description"]').content

How do I get the information from a meta tag with JavaScript?

BETA Snippet explanation automatically generated by OpenAI:

Here is what the above code is doing:
1. Find the meta tag with the name attribute set to description.
2. Return the content attribute of that tag.
"""

# Now let's take a look at what we've done.
#
# We will use the `print()` function to

Snippet By Tony Lea

·

Created June 6th, 2021

·

Report Snippet