# Element `Element`s are returned from [querying](querying.md) methods. ## properties ### name Gets the name of the `Element`. ```python html = HTML("Dormouse") span_element = html.root_element assert span_element.name == "span" ``` ### id #### Get the id ```python html = HTML('Dormouse') span_element = html.root_element assert span_element.id == "dormouse" ``` #### Set the id ```python html = HTML("Dormouse") span_element = html.root_element span_element.id = "dormouse" assert span_element.id == "dormouse" ``` ### attributes #### Get attributes ```python html = HTML('') button_element = html.root_element assert button_element.attributes == {"class": "mt-2 pb-2", "disabled": True} ``` #### Set attributes ```python html = HTML("") button_element = html.root_element button_element.attributes = {"class": "mt-2 pb-2", "disabled": True} assert str(button_element) == '' ``` ### classes Gets a list of classes for the element. ```python html = HTML('') button_element = html.root_element assert button_element.classes == ["mt-2", "pb-2"] ``` ### text #### Get text context ```python html = HTML("") button_element = html.root_element assert button_element.text == "Wake Up" ``` #### Set text content ```python html = HTML("") button_element = html.root_element button_element.text = "Go back to sleep" assert str(button_element) == "" ``` ### children Gets an iterator of the children for the element. ```python html = HTML("""