// Helpers for HTML element accessed by its identifier:
class HById
{
   static ElementOf<T extends HTMLElement>(id: string): T {
      let elem = document.getElementById(id);
      if (!elem)
         throw 'Element not found by id: "'+id+'".'
      let element = elem as T
      if (!element)
         throw 'Element "'+id+'"is not of "'+HOps.ObjectTypeName(elem)+'" type.'
      return element;
   }
   static GetElementOf<T extends HTMLElement>(id: string): T|null {
      return HElement.GetById(id) as T
   }

   static InputElement(id: string): HTMLInputElement {
      return HById.ElementOf<HTMLInputElement>(id)
   }
   static GetInputElement(id: string): HTMLInputElement|null {
      return HById.GetElementOf<HTMLInputElement>(id)
   }

   static Focus(id: string) {
      HElement.ById(id).focus()
   }
   static Click(id: string) {
      HElement.ById(id).click()
   }
} // HById
