MDN self-hosted library · e01.org
HTMLMetaElement / notebook

HTMLMetaElement

Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.

js
const meta = document.createElement("meta");
meta.name = "description";
meta.content =
  "The <meta> element can be used to provide document metadata in terms of name-value pairs, with the name attribute giving the metadata name, and the content attribute giving the value.";
document.head.appendChild(meta);
js
const meta = document.createElement("meta");
meta.name = "viewport";
meta.content = "width=device-width";
document.head.appendChild(meta);