本帖最后由 u014060578 于 2014-03-12 16:39:13 编辑

解决方案 »

  1.   

    id 呀 后面触发事件 时用他    <tr>
    <td>&nbsp;

    </td>
    <td colspan="7">
    <a href="javascript:;" id="addOption" class="button" onclick ="changeValue()">${message("admin.attribute.addOption")} </a>
    </td>
    </tr>
      

  2.   

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
      <title>登录</title>
      <script type="text/javascript" src='jquery-1.4.2.min.js'></script>
    </head>
    <body>
      <table id="attributeTable">
        <tr>
          <td colspan="7">
            <input type="text" name="delStorageInventoryIn[0].upc" class="text" maxlength="20" /> 
          </td>      <td colspan="7">
            <input type="text" name="delStorageInventoryIn[0].sn"class="text" maxlength="20" /> 
          </td>
          <script type="text/javascript">
            $(document).ready(function() {
              var parameterIndex = 1;          // 增加可选项
              $('#addOption').live("click", function() {            var $this = $(this);
                
                //[@compress single_line = true]
                var trHtml = '<tr class="optionTr">'+
                '<td>'+            '</td>'+
                '<td>'+
                '<input type="text" name="delStorageInventoryIn['+parameterIndex+'].upc" class="text upc" />'+
                '</td>'+
                '<td>'+
                '<input type="text" name="delStorageInventoryIn['+parameterIndex+'].memberSn" class="text memberSn" "/>'+
                '</td>'+
                '</tr>';
                     // [/@compress]
                     $('#attributeTable').before(trHtml);
                     parameterIndex ++;
                   });
            });
          </script>
          <td colspan="7">
            <input type="text" name="delStorageInventoryIn[0].upc" class="text" maxlength="20" /> 
          </td>      <td colspan="7">
            <input type="text" name="delStorageInventoryIn[0].sn"class="text" maxlength="20" /> 
          </td>
        </tr>    <tr>
          <td>       </td>
          <td colspan="7">
            <a href="javascript:;" id="addOption" class="button" onclick ="">修改</a>
          </td>
        </tr>  </table>
    </body>
    </html>