我有这段代码:
<fieldset>
<legend>Professional Ditails</legend>
<div id="initialTransInfoElement">
<p>
<label id="lblInstitution1">
Institution
<input type="text" name="inptInstitution" required="required" />
</label>
<label id="lblQualification1">
Qualification
<select name="cars">
<option value="volvo">Volvo</option>
<option value="saab">Saab</option>
<option value="fiat">Fiat</option>
<option value="audi">Audi</option>
</select>
</label>
</p>
</div>
<button type="button" name="button" onclick="test()">
test</button>
</fieldset>
<script type="text/javascript">
function toCelsius(fahrenheit) {
alert("DDD");
}
function test() {
var elem = $("#initialTransInfoElement").clone();
alert(elem.toString());
}
当我点击按钮&#34;测试&#34;我希望在alet窗口中看到复制的元素,但我得到警告窗口显示此文本:
的 [object Object]
我缺少什么?为什么我上面按摩了?如何显示复制的HTML代码?