26
Views
6
Comments
Solved
Hello master, please help me. It's about element ids in JavaScript.

in document, we avoid calling to element id, but we are safe to use when we do like this picture below. 
My question is "Is that dynamic identifier?". Tks for your answer.


Screenshot 2023-12-04 082402.png
2017-07-15 18-41-36
Sachin Mahawar
Solution

Hi Tony,

Widget element IDs are always generated automatically, and if you change your screen block design, the generated IDs may differ on the next publish.

Please refer below post for more details.

https://www.outsystems.com/forums/discussion/93169/i-need-to-know-more-about-id-selector-in-js/

Thanks,

Sachin

2024-05-15 07-07-20
Thinh Du

 Hello Sachin, tks for your reply. But my team leader told me that it's safe when i use element.id 
That's i wondering. it must be static element right?

2017-07-15 18-41-36
Sachin Mahawar

Hi Tony, Yes Its always safe to use element.id since it will not have any impact on the logic even though if its value got changed due to change in the design.

THanks,

Sachin

2023-11-22 10-51-50
Jozy Sohail

Hi Tony,

Yes that is a dynamic identifier. Means you will always get the correct id of element from element.ID

Hope it helps,

Thanks

2024-05-15 07-07-20
Thinh Du

Tks you all!!!!

2024-07-05 14-16-55
Daniël Kuhlmann
Ā 
MVP

I unmarked a few replies that incorrectly were marked as solution.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.