Skip to content

Commit

Permalink
fix attribute clone
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelWest22 authored Dec 9, 2024
1 parent a428ac0 commit de8b689
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion docs/htmx-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -627,7 +627,9 @@ var htmx = (function() {
if (!el.content) {
const template = el.ownerDocument.createElement('template')
el.parentNode.insertBefore(template, el)
cloneAttributes(template,el)
forEach(el.attributes, function(attr) {
template.setAttribute(attr.name, attr.value)
})
el.parentNode.removeChild(el)
while ((child = el.firstChild)) {
template.content.appendChild(child)
Expand Down

0 comments on commit de8b689

Please sign in to comment.