首先是这样点击Add a phone number,变成这个样点x又回到一写入数据后这样,点击Add another,可再次添加一个新的各位行行好,这个肿么写额。javascript

解决方案 »

  1.   

    本人表示没写过这个,但是可以给你说哈我的思路,这个用Ajax,在加上单机事件
      

  2.   

    JavaScript脚本动态创建dom元素
      

  3.   

    <style type='text/css'>
    dl dt { width:100px; float:left; }
    dl dd { margin-left:200px; }
    </style><script type='text/javascript'>
    var clone;
    $(function() {
      $('dl dd').click(function() {
        $(this).html("<input type='text' /> <select><option value='Work'>Work</option></select> <span class='close'>x</span>");
        clone = $(this).clone(true);
      });
      $('.class').live('click', function() {
        $(this).parent().html('Add a phone number');
      });
      $('dl dd input').keydown(function() {
        $('this').parent().append("<br /><span class='another'>Add another</span>");
      });
      $('.another').live('click', function() {
        $(this).parent().parent().append(clone);
      });
    });
    </script><dl>
      <dt>Phone</dt>
      <dd>Add a phone number</dd>
    </dl>
      

  4.   

    这个结贴弄个200分的帖子估计能有人写最多告诉你一个思路,然后你自己去写,有BUG可以来问这效果的代码不是几行就能解决的