diff --git a/src/htmx.js b/src/htmx.js index 7a5478b5..143e7939 100644 --- a/src/htmx.js +++ b/src/htmx.js @@ -411,10 +411,18 @@ return (function () { return function () { processNode(child, true); processScripts(child); + processFocus(child) triggerEvent(child, 'htmx:load', {}); }; } + function processFocus(child) { + var el = child.querySelector("[autofocus]") + if (el != null) { + el.focus() + } + } + function insertNodesBefore(parentNode, insertBefore, fragment, settleInfo) { handleAttributes(parentNode, fragment, settleInfo); while(fragment.childNodes.length > 0){