diff options
Diffstat (limited to 'lib/js')
-rw-r--r-- | lib/js/urweb.js | 9 |
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 |