diff --git a/packages/happy-dom/src/nodes/html-input-element/HTMLInputElement.ts b/packages/happy-dom/src/nodes/html-input-element/HTMLInputElement.ts index c21c80bc6..6de805e3b 100644 --- a/packages/happy-dom/src/nodes/html-input-element/HTMLInputElement.ts +++ b/packages/happy-dom/src/nodes/html-input-element/HTMLInputElement.ts @@ -596,6 +596,8 @@ export default class HTMLInputElement extends HTMLElement implements IHTMLInputE * @param value Value. */ public set value(value: string) { + // The value maybe not string, so we need to convert it to string + value = String(value); switch (this.type) { case 'hidden': case 'submit':