* Generates an arbitrary input form element. * The input type is controlled via user-provided parameters.
(bind4, el, param, value1)
| 142041 | * Generates an arbitrary input form element. |
| 142042 | * The input type is controlled via user-provided parameters. |
| 142043 | */ function form(bind4, el, param, value1) { |
| 142044 | const node = element("input"); |
| 142045 | for(const key in param)if (key !== "signal" && key !== "element") node.setAttribute(key === "input" ? "type" : key, param[key]); |
| 142046 | node.setAttribute("name", param.signal); |
| 142047 | node.value = value1; |
| 142048 | el.appendChild(node); |
| 142049 | node.addEventListener("input", ()=>bind4.update(node.value)); |
| 142050 | bind4.elements = [ |
| 142051 | node |
| 142052 | ]; |
| 142053 | bind4.set = (value)=>node.value = value; |
| 142054 | } |
| 142055 | /** |
| 142056 | * Generates a checkbox input element. |
| 142057 | */ function checkbox(bind5, el, param, value2) { |