Click here to Skip to main content
15,867,308 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Wondering why my dropdown button are not working after second dropdown jquery generated and so on. Thanks

Please find my sample code @ Edit fiddle - JSFiddle[^]

What I have tried:

i have try js .click and .on('click')
Posted
Updated 6-Sep-18 13:28pm
Comments
Nelek 6-Sep-18 16:30pm    
Insead of wanting us to download you code (which many users won't do for security), why don't you post the needed snippets here? It should be enough.

1 solution

Google 'jquery event delegation' and try to understand why that is happening.
To summarize, jQuery reads the DOM elements as soon as the page loads, and it cannot read new elements added dynamically to the DOM (from an ajax call, for example).
So once your ajax call ran successfully, your jQuery script will not work on the new elements. Check out the Q&A on StackOverflow regarding jQuery Event Delegation, you're sure to find what you need to know.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900