Add/removing div block jQuery

前端 未结 1 812
闹比i
闹比i 2021-01-27 09:29

I\'m writing a script to add div block after clicking the add button.
Everything is fine, however after adding second block that incrementing.

For example: After se

相关标签:
1条回答
  • 2021-01-27 10:03

    you need to append to a parent div, add an additional div

    like "container" on top of your "room-type" and append your clone to it

    room.clone().appendTo("#container");
    

    also before removing check the length of your "room-type" class

    here is a working fiddle for you

    https://jsfiddle.net/fxabnk4o/12/

    0 讨论(0)
提交回复
热议问题