How to selecting inconstant element with javascript ? (Angular.js) | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

How to selecting inconstant element with javascript ? (Angular.js)

we have example page with source code like this : <input ng-type="text" ng-class="seattleland" id="seattlenight01">welcome to class</input> after refresh page this code changed to <input ng-type="text" ng-class="seattleland" id="seattlenight02">welcome to class</input> and again after refresh the page <input ng-type="text" ng-class="seattleland" id="seattlenight03">welcome to class</input> how we can select inconstant elements like this? class is constant and id is inconstant every time

3rd Apr 2017, 9:29 PM
Sciencedirect
Sciencedirect - avatar
2 Answers
+ 4
First of all i have never seen any ng-id attribute in angular. Secondly, even if it is there you must be having a variable which will be auto incrementing every time. Otherwise, this would never happen, Lastly, if you would explain what you are trying to achieve i would be able to help you in more significant way.
4th Apr 2017, 2:42 AM
Ashwani Kumar
Ashwani Kumar - avatar
0
ng-id was basically fake example for start explaining about question ofcourse it was mistaken , at all i want to get data from this id but this id always change when i want to refresh the page, thanks ahead
4th Apr 2017, 9:03 PM
Sciencedirect
Sciencedirect - avatar