How the function "getElementById" works?

It is indicated in the documentation that we can use "getElementById" : https://help.hcl-software.com/domino_volt/1.0.1/ref_jsapi_javascript_security.html

Here a very simple example (in my own company's server (Volt 1.0.1)):

I have an HTML tag in my page whose id is "idTag" (created with the object palette) and a button whose onClick event executes the following javascript:

var myObj = document.getElementById('idTag');
alert(myObj);

When I click on the button, I get "null". How can I get this HTML object ?

Thanks for you help !

Interesting. I get the same result. Works on local deployment with secureJS=false. Returns "null" on the sandbox.

Thank you for your reply, but I cannot disable javascript security due to anonymous access to the application.