The library request preview needs separate feedback for blank and valid book titles. It does not send or reserve anything. The form, label, live status, and description connection are supplied.
Edit the marked parts of script.js. The existing submit listener reads a trimmed title and returns from the blank branch. That structure lets you add one outcome at a time without wiring more listeners.
Use setAttribute("aria-invalid", "true") to expose a field error, .focus() to put keyboard focus on that field, and removeAttribute("aria-invalid") after correction. Write messages with textContent, including titles that look like markup.
Enter a book title before requesting a hold.#book invalid and focus it so the error can be corrected.Hold requested for TITLE. with the trimmed title replacing TITLE as literal text.aria-invalid attribute.Run and Submit after each step. Try spaces, then River Atlas , then <em>Reed</em>. A correction should replace the error message and remove the invalid state; it must not create an em element.