Skip to content

Commit a014b29

Browse files
committed
LibWeb: Add Element.tagName and Element.className
1 parent a64033e commit a014b29

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

Libraries/LibWeb/DOM/Element.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,9 @@ class Element : public ParentNode {
8484
String id() const { return attribute(HTML::AttributeNames::id); }
8585
void set_id(const String& value) { set_attribute(HTML::AttributeNames::id, value); }
8686

87+
String class_name() const { return attribute(HTML::AttributeNames::class_); }
88+
void set_class_name(const String& value) { set_attribute(HTML::AttributeNames::class_, value); }
89+
8790
protected:
8891
RefPtr<LayoutNode> create_layout_node(const StyleProperties* parent_style) const override;
8992

Libraries/LibWeb/DOM/Element.idl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
interface Element : Node {
22

3+
readonly attribute DOMString tagName;
4+
35
DOMString? getAttribute(DOMString qualifiedName);
46
void setAttribute(DOMString qualifiedName, DOMString value);
57

68
attribute DOMString innerHTML;
79
attribute DOMString id;
10+
attribute DOMString className;
811

912
}
1013

0 commit comments

Comments
 (0)