<form action="" id='test-form'>
      <input type="text" class='form-control' onclick='addInput(this)'>
    </form>

<script>

  function addInput(input)
  {
    if ($(input).next().length == 0) {
        $(input).after("<input type='text' class='form-control' onclick='addInput(this)'>");
    }
  }
</script>

 

posted on 2017-04-10 10:33  jzfan  阅读(481)  评论(0编辑  收藏  举报