<p>
<label for="comment">Comment</label>
<textarea id="comment" minlength="10" maxlength="200"></textarea>
</p>HTMLTextAreaElement: minLength property / notebook
HTMLTextAreaElement: minLength property
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.
const textareaElement = document.querySelector("#comment");
console.log(`Element's minLength: ${textareaElement.minLength}`); // "Element's minlength: 10"
textareaElement.minLength = 5; // updates the element's minlength attribute value