Question
· Apr 1, 2021

zenPage

Hello, in a zen page sometimes I find document.getElementbyId("ID") to set a propertybut also zen("ID").setPr.... So what is the real difference and limitations of each?

Product version: IRIS 2020.4
Discussion (4)3
Log in or sign up to continue

zen(id) is shorthand for zenPage.getComponentById(id) which as @Vitaliy.Serdtsev said gives you access to the Zen component identified by id. document.getElementById(id) gives you access to the element identified by id in HTML/JavaScript document object model. Since a Zen component could comprise several HTML elements, it's usually better to use zen(id).