Skip to content
Advertisement

dropdown select not being part upon the process of cloning

Cloning code works it’s just that the dropdown select is not being part of the cloning process.

JavaScript
JavaScript

What I am trying to do is, also pass the value of dropdown select of row to be cloned upon the process of cloning the row.

Advertisement

Answer

  1. live is deprecated so update your jQuery library.

  2. For your question:

    1. First of all find and get selected option and add attribute selected to selected option.

    2. To get events of dynamic created elements , use event delegation.

Example:

JavaScript
JavaScript
User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement