summaryrefslogtreecommitdiff
path: root/jslib
diff options
context:
space:
mode:
Diffstat (limited to 'jslib')
-rw-r--r--jslib/urweb.js8
1 files changed, 8 insertions, 0 deletions
diff --git a/jslib/urweb.js b/jslib/urweb.js
index 9d28b461..0f9c06cf 100644
--- a/jslib/urweb.js
+++ b/jslib/urweb.js
@@ -41,6 +41,14 @@ function dyn(s) {
s.h = cons(function() { x.innerHTML = s.v }, s.h);
}
+function inp(t, s) {
+ var x = document.createElement(t);
+ x.value = s.v;
+ document.body.appendChild(x);
+ s.h = cons(function() { x.value = s.v }, s.h);
+ x.onkeyup = function() { sv(s, x.value) };
+}
+
function eh(x) {
return x.split("&").join("&amp;").split("<").join("&lt;").split(">").join("&gt;");
}