diff --git a/Libraries/LibWeb/DOM/Element.h b/Libraries/LibWeb/DOM/Element.h index 70f93dbdc5..7882c913e5 100644 --- a/Libraries/LibWeb/DOM/Element.h +++ b/Libraries/LibWeb/DOM/Element.h @@ -84,6 +84,9 @@ public: String id() const { return attribute(HTML::AttributeNames::id); } void set_id(const String& value) { set_attribute(HTML::AttributeNames::id, value); } + String class_name() const { return attribute(HTML::AttributeNames::class_); } + void set_class_name(const String& value) { set_attribute(HTML::AttributeNames::class_, value); } + protected: RefPtr create_layout_node(const StyleProperties* parent_style) const override; diff --git a/Libraries/LibWeb/DOM/Element.idl b/Libraries/LibWeb/DOM/Element.idl index af914db646..f2d9d3cba3 100644 --- a/Libraries/LibWeb/DOM/Element.idl +++ b/Libraries/LibWeb/DOM/Element.idl @@ -1,10 +1,13 @@ interface Element : Node { + readonly attribute DOMString tagName; + DOMString? getAttribute(DOMString qualifiedName); void setAttribute(DOMString qualifiedName, DOMString value); attribute DOMString innerHTML; attribute DOMString id; + attribute DOMString className; }