From a8e63939847f6fb02b2dc030adca09e554adb89f Mon Sep 17 00:00:00 2001 From: Adam Chlipala Date: Sat, 21 Jul 2012 11:59:41 -0400 Subject: Basis.giveFocus --- lib/js/urweb.js | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'lib/js/urweb.js') 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 -- cgit v1.2.3