document.getElementById() returns null for template HTML

The template has a div with an ID. I can see the new div on the DOM. When I attempt to get that node with document.getElementById(), it just returns null.

In Chrome, I drill in to the “webix_template” class div. The first child should be the div I am looking for. I see it in the Elements of the page, but I still cannot query it with getElementById().

If element is visible on the page, it must be accessible by getElementsById

There are two possible problems

  • template in multivew|tabview ( hidden tabs are outside of DOM and will not be accessible )
  • using “template:‘html->container_id’” to load a custom HTML into the template, this operations creates a copy of content, so there will be two elements with the same ID. Use a “content:‘container_id’” instead.

I can see the DOM element in Chrome. I was trying something anyways which I stopped investigating and I moved on to something else.