chr*_*ude 1 html javascript jquery
我有以下HTML:
<div id="popups">
<div id="createform">
<div id="createformInside">
<input type="text" id="testTitle" size="20">
<input type="text" id="testSubj">
<span id="testOptions">More Options</span>
<br/>
<textarea id="testContent" ></textarea>
<input type="button" value="Save Test" id="saveBttn">
</div>
</div>
</div>
Run Code Online (Sandbox Code Playgroud)
下面的jQuery应该在<div>
按下保存按钮时删除弹出窗口内的所有内容.出于某种原因,事实并非如此.知道为什么不呢?
$('#saveBttn').click( function() {//if the save button on the create test form is clicked...
$('#createform').remove();//gets rid of the create test form
})
Run Code Online (Sandbox Code Playgroud)