diff --git a/Userland/Libraries/LibWeb/DOM/HTMLFormControlsCollection.cpp b/Userland/Libraries/LibWeb/DOM/HTMLFormControlsCollection.cpp
index afac7db0c6..6faa61899a 100644
--- a/Userland/Libraries/LibWeb/DOM/HTMLFormControlsCollection.cpp
+++ b/Userland/Libraries/LibWeb/DOM/HTMLFormControlsCollection.cpp
@@ -48,7 +48,7 @@ Variant> HTMLFormControlsCollection::
auto collection = collect_matching_elements();
for (auto const& element : collection) {
- if (element->deprecated_attribute(HTML::AttributeNames::id) != deprecated_name && element->name() != deprecated_name)
+ if (element->id() != name && element->name() != deprecated_name)
continue;
if (matching_element) {
@@ -68,12 +68,12 @@ Variant> HTMLFormControlsCollection::
// 4. Otherwise, create a new RadioNodeList object representing a live view of the HTMLFormControlsCollection object, further filtered so that the only nodes in the
// RadioNodeList object are those that have either an id attribute or a name attribute equal to name. The nodes in the RadioNodeList object must be sorted in tree
// order. Return that RadioNodeList object.
- return JS::make_handle(RadioNodeList::create(realm(), root(), LiveNodeList::Scope::Descendants, [deprecated_name](Node const& node) {
+ return JS::make_handle(RadioNodeList::create(realm(), root(), LiveNodeList::Scope::Descendants, [name, deprecated_name](Node const& node) {
if (!is(node))
return false;
auto const& element = verify_cast(node);
- return element.deprecated_attribute(HTML::AttributeNames::id) == deprecated_name || element.name() == deprecated_name;
+ return element.id() == name || element.name() == deprecated_name;
}));
}