const img = new Image();
img.src = "example.png";
img.alt = "An example picture";
img.name = "example-img";HTMLImageElement: name property / notebook
HTMLImageElement: name property
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.
img.id = "example-img";