Add / remove input field dynamically with jQuery

前端 未结 12 1903
闹比i
闹比i 2020-12-02 06:14

I would like to use jquery to build a dynamic add/ remove form. IT should look like:

Name Type Required?

The example input :

  • Name Type Require
12条回答
  •  时光说笑
    2020-12-02 06:52

    You can do something like this below:

    //when the Add Field button is clicked
    $("#add").click(function (e) {
    //Append a new row of code to the "#items" div
      $("#items").append('
    '); });

    For detailed tutorial http://voidtricks.com/jquery-add-remove-input-fields/

提交回复
热议问题