diff --git a/Userland/Libraries/LibWeb/HTML/HTMLSelectElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLSelectElement.cpp
index 73dc93c6f3..f5e8845e54 100644
--- a/Userland/Libraries/LibWeb/HTML/HTMLSelectElement.cpp
+++ b/Userland/Libraries/LibWeb/HTML/HTMLSelectElement.cpp
@@ -129,4 +129,17 @@ i32 HTMLSelectElement::default_tab_index_value() const
return 0;
}
+// https://html.spec.whatwg.org/multipage/form-elements.html#dom-select-type
+String const& HTMLSelectElement::type() const
+{
+ // The type IDL attribute, on getting, must return the string "select-one" if the multiple attribute is absent, and the string "select-multiple" if the multiple attribute is present.
+ static String select_one = "select-one"sv;
+ static String select_multiple = "select-multiple"sv;
+
+ if (!has_attribute(AttributeNames::multiple))
+ return select_one;
+
+ return select_multiple;
+}
+
}
diff --git a/Userland/Libraries/LibWeb/HTML/HTMLSelectElement.h b/Userland/Libraries/LibWeb/HTML/HTMLSelectElement.h
index cde0d812e7..0d50f14510 100644
--- a/Userland/Libraries/LibWeb/HTML/HTMLSelectElement.h
+++ b/Userland/Libraries/LibWeb/HTML/HTMLSelectElement.h
@@ -56,6 +56,8 @@ public:
// https://html.spec.whatwg.org/multipage/forms.html#category-label
virtual bool is_labelable() const override { return true; }
+ String const& type() const;
+
private:
HTMLSelectElement(DOM::Document&, DOM::QualifiedName);
diff --git a/Userland/Libraries/LibWeb/HTML/HTMLSelectElement.idl b/Userland/Libraries/LibWeb/HTML/HTMLSelectElement.idl
index c1a1297d64..b7801b6811 100644
--- a/Userland/Libraries/LibWeb/HTML/HTMLSelectElement.idl
+++ b/Userland/Libraries/LibWeb/HTML/HTMLSelectElement.idl
@@ -10,6 +10,8 @@ interface HTMLSelectElement : HTMLElement {
[Reflect] attribute boolean required;
[SameObject] readonly attribute HTMLOptionsCollection options;
+ readonly attribute DOMString type;
+
readonly attribute unsigned long length;
getter Element? item(unsigned long index);
getter Element? namedItem(DOMString name);