summaryrefslogtreecommitdiffstats
path: root/remoting/webapp/base/js/base.js
diff options
context:
space:
mode:
Diffstat (limited to 'remoting/webapp/base/js/base.js')
-rw-r--r--remoting/webapp/base/js/base.js12
1 files changed, 12 insertions, 0 deletions
diff --git a/remoting/webapp/base/js/base.js b/remoting/webapp/base/js/base.js
index 6f11278..f51181e 100644
--- a/remoting/webapp/base/js/base.js
+++ b/remoting/webapp/base/js/base.js
@@ -861,3 +861,15 @@ base.isNaclEnabled = function() {
}
return false;
};
+
+/**
+ * Alias for document.getElementById that returns an HTMLElement
+ * @param {string} id The ID of the element to find.
+ * @return {?HTMLElement} The found element or null if not found.
+ */
+base.getHtmlElement = function(id) {
+ var el = document.getElementById(id);
+ if (el)
+ console.assert(el instanceof HTMLElement);
+ return /** @type {HTMLElement} */(el);
+};