3 ms·
normal javascript functions that htmx would just call: <button hx-post="/api/data" hx-swap="outerHTML" hx-trigger="click" hx-ext="localStorageHandler">Save Dat
by andrewfromx 3y ago
normal javascript functions that htmx would just call:
<button hx-post="/api/data" hx-swap="outerHTML" hx-trigger="click" hx-ext="localStorageHandler">Save Data</button>
<script>
function localStorageHandler(element) {
// Get the input value
const inputValue = document.getElementById('inputField').value;
// Save the value to localStorage
localStorage.setItem('myData', inputValue);
}
</script>
- ssss11 3y agoOk cool thanks!