删除一个div我有它的HTML看起来像一个形式:jQuery的 - 从形式
<div id="form_container">
<h1><a>Untitled Form</a></h1>
<form action="save_form" method="post" id="newform" name="newform">
<div class="form_description">
<h2 class="editable">Form title. Click here to edit</h2>
<p class="editable">This is your form description. Click here to edit.</p>
</div>
<ul id="form_body">
<li id="field1" class="world">
<a href="#" onclick="return false;" class="hover">
<label class="editable" for="field1">Text1</label>
<input type="text" name="field1" value=""></a>
<div class="element_actions">
<img src="/images/ico_delete_16.png" alt="Delete." title="Delete" class="remove_element">
</div>
</li>
</ul>
</form>
</div>
我想克隆形式,并从中取出“element_actions” DIV。我不想修改现有的表单,只是它的克隆版本。
我试过'remove()'和'detach'没有成功。
下面是对的jsfiddle测试:http://jsfiddle.net/truthseeker/LYCkt/
感谢您的帮助。
您可以按 “TidyUp” 按钮。它正确缩进代码,使其更易于阅读。 ':)' –
抱歉。 – truthSeekr
没问题':p' –