How to change the style of an element with Javascript?

I have a nanoflow with a Javascript call. I would like to change the css attributes of a DOM element. I have checked in the console : my element exists and is not empty.   The problem is that the javascript instructions I knew are not recognized by Mendix. How to something like = ‘value’?   Thanks
2 answers

Hi Ariel,


Normally I would say to create a class and do you styling on that. However sometimes this is (sadly) not possible. You can use JS for that with the following syntax:

var ObjectInDom = document.getElementsByClassName('ClassName')[0]; // Make sure you can identify only 1 object'height', '100%');

In the setProperty you can put whatever style you want. See


Good luck


well some ways are 

1.write a nanoflow on the page add the javascript call to it

in that java script call u can write any java script code which will work.


2.add the HTMl snippet and add the javascript there.