comparison lib/js/urweb.js @ 1785:ffd7ed3bc0b7

Basis.giveFocus
author Adam Chlipala <adam@chlipala.net>
date Sat, 21 Jul 2012 11:59:41 -0400
parents 5bc4fbf9c0fe
children d794149b3713
comparison
equal deleted inserted replaced
1784:e6bc6bbd7a32 1785:ffd7ed3bc0b7
1822 1822
1823 function fresh() { 1823 function fresh() {
1824 return "uw" + (--nextId); 1824 return "uw" + (--nextId);
1825 } 1825 }
1826 1826
1827 function giveFocus(id) {
1828 var node = document.getElementById(id);
1829
1830 if (node)
1831 node.focus();
1832 else
1833 er("Tried to give focus to ID not used in document: " + id);
1834 }
1835
1827 1836
1828 // App-specific code 1837 // App-specific code