summaryrefslogtreecommitdiff
path: root/lib/js/urweb.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
commit6ee57363d23e05fd783d8b7d151a249c0efdcd23 (patch)
tree13683afe5e2e162dec21d810da31708f220d3fb5 /lib/js/urweb.js
parent84a14ca026a8ca7ed4488e51506340b249809fae (diff)
Basis.giveFocus
Diffstat (limited to 'lib/js/urweb.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