From ef730551a6739179a37fa04df28db4f194a42b51 Mon Sep 17 00:00:00 2001 From: Carson Gross Date: Sat, 6 Dec 2025 11:16:12 -0700 Subject: [PATCH] add `strip` documentation --- www/content/attributes/hx-swap.md | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/www/content/attributes/hx-swap.md b/www/content/attributes/hx-swap.md index 8b18a5ee..26972143 100644 --- a/www/content/attributes/hx-swap.md +++ b/www/content/attributes/hx-swap.md @@ -128,12 +128,27 @@ You may also use `window:top` and `window:bottom` to scroll to the top and botto ```html -
Get Some Content
``` +#### Unwrapping: `strip` + +The `strip` modifier allows you to control whether the outer element of the response content should be removed before swapping. This is useful when you want to swap only the children of the response's root element. + +If the server response is: +```html +
+

Content 1

+

Content 2

+
+``` + +With `strip:true`, only the `

` elements are swapped in. +With `strip:false`, the entire `

` and its contents are swapped in. + ## Notes * The default value of this attribute is `innerHTML`