Element ID

0
Hi there, I'm trying to execute some javascript in my application. For which, I need to refer element ids. The button ids keep changing with every run and javascript function gives 'null' error. My goal is to focus on a div, when the button is clicked. How can I achieve that?
asked
3 answers
1

Hi Vertika,

You can add a class to to a button or container to be able to target it with javascript. To add a class, open up the properties dialog box. 

 

I usually add a custom class specific to a container or button to be able to target that specific element.

 

answered
1

The Name property of widgets is in my opinion the way to go.

If you have a widget with

it will have the class mx-name-text3

Iterator widgets will create index classes for their entries like mx-name-index-0

answered
0

Why outsystem can set id for each element, but mendix can not ?

answered