How to get dynamically created option?

first of all, ajax dynamically pulls the data to fill the option, of select, and then ajax pulls the data to compare with the newly populated option. If the value is equal, it becomes a selected (selected), but when comparing, it finds that no option. can be obtained. What should I do?

Mar.07,2021

Why not return both data from an ajax?
the first ajax returns list, and the second returns a subset of the first list.
where you add a selected field to an entity that has the original list in an ajax, or you can return the selected data with another field in the first ajax.
eg:

  • add entities:
  

as long as append goes to dom, you can definitely get it. Paste the code to see if there is something wrong with it.

Menu