我有一个内部有一段PHP代码的div
我需要复制div和php,我该怎么做?
克隆方法在php中显然不起作用,只能克隆div但没有php代码。
<div id="wrap" style="margin: 80px;">
<p>
<label>Área profissional :</label> <select name="area" class="area">
<option selected="selected">Seleccione a Área</option>
<?php
$sql=mysql_query("select id_formation_area, area from formation_area");
while($row=mysql_fetch_array($sql)){
$area=$row['area'];
$id_area=$row['id_formation_area'];
echo '<option value='.$id_area.'>'.$area.'</option>';
}
?>
</select> <label>Profissão:</label> <select name="profissao"
class="profissao">
<option selected="selected">Seleccione a profissão</option>
</select> <label>Gráfico:</label> <select name="estatistica"
class="estatistica">
<option selected="selected">Seleccione a estatistica</option>
</select> <span class="remove">Remove</span>
</p>
<p>
<span class="add">Add fields</span>
</p>
</div>
答案 0 :(得分:1)
答案 1 :(得分:0)
如果要克隆div#wrap
使用:
$("#wrap").clone().insertAfter($("#wrap"));