summaryrefslogtreecommitdiff
path: root/lib/js
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adam@chlipala.net>2012-07-21 11:59:41 -0400
committerGravatar Adam Chlipala <adam@chlipala.net>2012-07-21 11:59:41 -0400
commita8e63939847f6fb02b2dc030adca09e554adb89f (patch)
tree13683afe5e2e162dec21d810da31708f220d3fb5 /lib/js
parentda2141fbf28e6173f587ee146acc8f78b7ea8e0d (diff)
Basis.giveFocus
Diffstat (limited to 'lib/js')
-rw-r--r--lib/js/urweb.js9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/js/urweb.js b/lib/js/urweb.js
index 5846863a..35023924 100644
--- a/lib/js/urweb.js
+++ b/lib/js/urweb.js
@@ -1824,5 +1824,14 @@ function fresh() {
return "uw" + (--nextId);
}
+function giveFocus(id) {
+ var node = document.getElementById(id);
+
+ if (node)
+ node.focus();
+ else
+ er("Tried to give focus to ID not used in document: " + id);
+}
+
// App-specific code