.. index:: pair: Attribute Inheritance ; Htmx .. _attribute_inheritance: ================================================================================== Attribute Inheritance ================================================================================== - https://htmx.org/docs/#inheritance Introduction ============== Most attributes in htmx are inherited: they apply to the element they are on as well as any children elements. This allows you to "hoist" attributes up the DOM to avoid code duplication. Consider the following htmx: .. code-block:: html Here we have a duplicate hx-confirm attribute. We can hoist this attribute to a parent element: .. code-block:: html