htmx-ext-disable-element

2.0.0 • Public • Published

NOTE: This extensions functionality has been folded into the core of htmx via the hx-disabled-elt attribute

This extension disables an element during an htmx request, when configured on the element triggering the request.

Install

<script src="https://unpkg.com/htmx-ext-disable-element@2.0.0/disable-element.js"></script>

Usage

Nominal case: disabling the element triggering the request

<button hx-get="/whatever" hx-ext="disable-element" hx-disable-element="self">Click me</button>

Disabling another element

<button hx-get="/whatever" hx-ext="disable-element" hx-disable-element="#to-disable">Click me</button>
<button id="to-disable">Watch me being disabled</button>

Disabling multiple elements

<button hx-get="/whatever" hx-ext="disable-element" hx-disable-element=".to-disable">Click me</button>
<button class="to-disable">Watch me being disabled</button>
<button class="to-disable">Watch me being disabled also</button>

Readme

Keywords

none

Package Sidebar

Install

npm i htmx-ext-disable-element

Weekly Downloads

1

Version

2.0.0

License

none

Unpacked Size

10.5 kB

Total Files

7

Last publish

Collaborators

  • carsongross