const errorButton = document.getElementById("checkErrors");
const errors = issuesToReport();
if (errors) {
errorButton.setCustomValidity("There is an error");
} else {
errorButton.setCustomValidity("");
}HTMLButtonElement: setCustomValidity() method
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.