<div class="codetitle"> <span><a style="CURSOR: pointer" data="4575" class="copybut" id="copybut4575" onclick="doCopy('code4575')"><u>複製程式碼</u></a></span>如下程式碼:</div> <div class="codebody" id="code4575"> <br><br> head><br> <title>ff 與ie 動態載入元素的差異</title> <br> <script type="text/javascript" src="jquery-1.4.4.min.js%20"></script> <br> <style type="text/css"><BR> li{margin:0;padding:0;list-style:none}<BR> </style>; <br> <script type="text/ javascript"><BR> function add(){<BR> var liTemplate = $("#template");<BR> liTemplate.find("input[name=' awbpre']").val("999"").val" ;<BR> liTemplate.find("input[name='awbno']").val("12312311"); <BR> $("#box").append("<li>" liTemplate.html(html) ""); <BR> }<BR> </script><br><br><br> <ul id="box"> <br> <li id="template " style="display:none"> <br> awbpre:<br> <input type="text" value="#awbno#" name="awbpre"><br> </li> <br> </ul> <br> <input type="button" value="add" onclick="return add()"><br><br> </div>