-2

I have a HTML which is working fine, but i have to create some part of this HTML dynamically through JQuery, but when i am doing this through JQuery, my input fields and buttons that were working before in HTML, are not working when i created the HTML dynamically.

without creating dynamic HTML

enter image description here

with dynamic HTML using jquery

enter image description here

enter image description here

enter image description here

enter image description here

enter image description here

i have tried creating the html of my form group dynamically but unfortunately whenever i do it i lost the functionality of my input and buttons

i expect that the html which i am creating from my jquery function which includes inputs and buttons should work the same way like it is working in normal HTML

James Z
  • 12,209
  • 10
  • 24
  • 44
  • If you lost functionality, then you likely have a javascript bug. What error shows in your console tab? – twalow Aug 17 '23 at 16:59
  • 3
    Welcome! Please take the [tour](https://stackoverflow.com/tour), read [How to create a Minimal, Reproducible Example](https://stackoverflow.com/help/minimal-reproducible-example) and [How do I ask a good question?](https://stackoverflow.com/help/how-to-ask) and don't post [images of code](https://meta.stackoverflow.com/questions/285551/why-not-upload-images-of-code-errors-when-asking-a-question)! – brombeer Aug 17 '23 at 17:03
  • thank you for ur reply but unfortunately no errors in cosole. my fields are not fetching the data from api if i create the fields from jquery.please check the screenshots attached. thank you once again – Amad Khan Aug 17 '23 at 17:08
  • 1
    No one wants screenshots of code. We can not easily copy and paste from it. – epascarello Aug 17 '23 at 17:23
  • 1
    So you are wondering why things like autocomplete do not work? When things are aded after the page load, those libraries you are using probably have no clue you added content so you would have to read their documentation and see how to initialize them. – epascarello Aug 17 '23 at 17:26

0 Answers0