diff --git a/src/htmx.d.ts b/src/htmx.d.ts index 3775459f4..2176ff4b5 100644 --- a/src/htmx.d.ts +++ b/src/htmx.d.ts @@ -113,7 +113,7 @@ type HtmxAjaxHelperContext = { source?: Element | string; event?: Event; handler?: HtmxAjaxHandler; - target: Element | string; + target?: Element | string; swap?: HtmxSwapStyle; values?: any | FormData; headers?: Record; diff --git a/src/htmx.js b/src/htmx.js index 73585d8ab..401e1585f 100644 --- a/src/htmx.js +++ b/src/htmx.js @@ -5036,7 +5036,7 @@ var htmx = (function() { * @property {Element|string} [source] * @property {Event} [event] * @property {HtmxAjaxHandler} [handler] - * @property {Element|string} target + * @property {Element|string} [target] * @property {HtmxSwapStyle} [swap] * @property {Object|FormData} [values] * @property {Record} [headers] diff --git a/www/content/api.md b/www/content/api.md index 17e116d55..a19dcc94d 100644 --- a/www/content/api.md +++ b/www/content/api.md @@ -53,7 +53,7 @@ or * `verb` - 'GET', 'POST', etc. * `path` - the URL path to make the AJAX * `context` - a context object that contains any of the following - * `source` - the source element of the request + * `source` - the source element of the request, `hx-*` attrs which affect the request will be resolved against that element and its ancestors * `event` - an event that "triggered" the request * `handler` - a callback that will handle the response HTML * `target` - the target to swap the response into