diff --git a/packages/happy-dom/src/nodes/html-button-element/HTMLButtonElement.ts b/packages/happy-dom/src/nodes/html-button-element/HTMLButtonElement.ts
index 65aa54fb7..14252f73a 100644
--- a/packages/happy-dom/src/nodes/html-button-element/HTMLButtonElement.ts
+++ b/packages/happy-dom/src/nodes/html-button-element/HTMLButtonElement.ts
@@ -211,7 +211,7 @@ export default class HTMLButtonElement extends HTMLElement implements IHTMLButto
const form = this._formNode;
switch (this.type) {
case 'submit':
- form.requestSubmit();
+ form.requestSubmit(this);
break;
case 'reset':
form.reset();
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 75781d48b..893bcf236 100644
--- a/packages/happy-dom/src/nodes/html-input-element/HTMLInputElement.ts
+++ b/packages/happy-dom/src/nodes/html-input-element/HTMLInputElement.ts
@@ -1205,7 +1205,7 @@ export default class HTMLInputElement extends HTMLElement implements IHTMLInputE
} else if (inputType === 'submit') {
const form = this._formNode;
if (form) {
- form.requestSubmit();
+ form.requestSubmit(this);
}
} else if (inputType === 'reset' && this.isConnected) {
const form = this._formNode;
diff --git a/packages/happy-dom/test/nodes/html-button-element/HTMLButtonElement.test.ts b/packages/happy-dom/test/nodes/html-button-element/HTMLButtonElement.test.ts
index 4aeef9956..f8e383a29 100644
--- a/packages/happy-dom/test/nodes/html-button-element/HTMLButtonElement.test.ts
+++ b/packages/happy-dom/test/nodes/html-button-element/HTMLButtonElement.test.ts
@@ -2,6 +2,7 @@ import Window from '../../../src/window/Window.js';
import Document from '../../../src/nodes/document/Document.js';
import IHTMLButtonElement from '../../../src/nodes/html-button-element/IHTMLButtonElement.js';
import Event from '../../../src/event/Event.js';
+import SubmitEvent from '../../../src/event/events/SubmitEvent';
import IHTMLElement from '../../../src/nodes/html-element/IHTMLElement.js';
import IHTMLFormElement from '../../../src/nodes/html-form-element/IHTMLFormElement.js';
import ValidityState from '../../../src/validity-state/ValidityState.js';
@@ -255,11 +256,16 @@ describe('HTMLButtonElement', () => {
document.body.appendChild(form);
- form.addEventListener('submit', () => submitTriggeredCount++);
+ let submitter: IHTMLElement | null = null;
+ form.addEventListener('submit', (event) => {
+ submitTriggeredCount++;
+ submitter = (event).submitter;
+ });
button.click();
expect(submitTriggeredCount).toBe(1);
+ expect(submitter).toEqual(button);
});
it('Resets form if type is "reset" and is a "click" event.', () => {