<label for="username">Enter your username:</label>
<input id="username" name="username" type="text" />HTMLLabelElement: htmlFor property / notebook
HTMLLabelElement: htmlFor property
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.
document.querySelector("label").htmlFor;
// username