当前位置: 代码迷 >> HTML/CSS >> JS中用innerHTML生成<s:select>的有关问题
  详细解决方案

JS中用innerHTML生成<s:select>的有关问题

热度:78   发布时间:2012-10-08 19:54:56.0
JS中用innerHTML生成<s:select>的问题
  the_cell=newrow.insertCell(4);  
   the_cell.innerHTML="<div><s:select id='shequxuanze' headerValue='--Please select--' headerKey='' list='#request.resultList' listKey='#request.shequ.sqName' listValue='#request.shequ.sqName'></s:select></div>";
  


实际生成的代码:
   the_cell=newrow.insertCell(4);  
   the_cell.innerHTML="<div>
<tr>
    <td class="tdLabel"></td>
    <td><select name="" id="shequxuanze">
        <option value="">--Please select--</option>
        <option value="健翔园社区">健翔园社区</option>
        <option value="安翔里社区">安翔里社区</option>
        </select>
    </td>
</tr>
</div>";


为什么会这样呢  多了tr td
  相关解决方案