2017  Kodetalk | Feedback | Privacy Policy | Terms | About
userimage

dynamically created divs inside div trying to remove chield divs by id using jquery remove() but not working

I am creating divs dynamically after getting json from server and the divs

<div id="parentdiv">
       <div id="newparentdiv"></div>
       <div id="childdiv"> here created divs will dynamically inserted with random id </div>
</div>

the JSON object i am geting where i am giving time as id as like this 2016-12-02T04:03:43.154


When i am trying to remove the dynamically created divs by id, it's not working.

I am using $("#"+id).remove()
It should work but not sure what is wrong with my process.

userimage

Just remove all the special characters from the date and remove should work fine.

I mean the date u passing as ID will look like this: 20161202T040343154

And to remove the special characters use this

Answer is