我的问题是如何在点击其他代码后删除此代码:
<table><tr><td>
<h3>What power does you character have?</h3>
<label><input type="radio" name="prefer" value="1" /> Speed</label><br/>
<label><input type="radio" name="prefer" value="2" /> Strength</label><br/>
<label><input type="radio" name="prefer" value="3" /> Invisablity</label><br/>
<label><input type="radio" name="prefer" value="4" /> Flight</label><br/>
</td></tr></table>
这是我想要下拉的代码(如果你点击速度)
<table><tr><td>
<h3>Does he can slow down time?</h3>
<label><input type="radio" name="prefer" value="1" /> Speed</label><br/>
<label><input type="radio" name="prefer" value="2" /> Strength</label><br/>
<label><input type="radio" name="prefer" value="3" /> Invisablity</label><br/>
<label><input type="radio" name="prefer" value="4" /> Flight</label><br/>
</td></tr></table>
有人可以帮助我吗?
答案 0 :(得分:0)
你可以用手风琴来完成这个任务。
$( function() {
$( "#accordion" ).accordion( {collapsible: true, active: false });
} );
<link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
<script src="https://code.jquery.com/jquery-1.12.4.js"></script>
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
<div id="accordion">
<h3>Does he can slow down time?</h3>
<div>
<label><input type="radio" name="prefer" value="1" /> Speed</label><br/>
<label><input type="radio" name="prefer" value="2" /> Strength</label><br/>
<label><input type="radio" name="prefer" value="3" /> Invisablity</label><br/>
<label><input type="radio" name="prefer" value="4" /> Flight</label><br/>
</div>
</div>