我有一个包含25个Q的网页。每个有4个选项。当用户点击按钮时,应该显示所有的glyphicon-ok应用程序,并且应该显示选中的单选按钮旁边的glyphicon-remove。怎么做。单击提交按钮时,在选中的单选按钮旁边显示隐藏的跨度
我应该在下面的函数中添加什么。
$("#sub").click(function(){
});
我尝试使用CSS
/*
.glyphicon-remove
{
display: none;
}
input:checked + span{
display: block;
}
*/
我的HTML:
<form>
<div class="form-group">
<label for="usr">Q25: A small bullet can kill a man if its momentum is great, a heavy truck moving a small speed can kill a man easily sue to it momentum.-> Is as per which law of motion </label>
</div>
<div class="radio">
<label><input type="radio" value="-0.33" name="optradio25">first<span class="glyphicon glyphicon-remove"></span></label>
</div>
<div class="radio">
<label><input type="radio" value="1" name="optradio25"> second <span class="glyphicon glyphicon-ok"></span></label>
</div>
<div class="radio">
<label><input type="radio" value="-0.33" name="optradio25">third<span class="glyphicon glyphicon-remove"></span></label>
</div>
<div class="radio">
<label><input type="radio" value="-0.33" name="optradio25">none<span class="glyphicon glyphicon-remove"></span></label>
</div>
<br />
<table class="table table-hover" style="width: 100%;border: 0px">
<tbody>
<tr>
<td>
<button id="sub" type="button" class="btn btn-primary">Submit</button>
</td>
<td align="right">
<button id="reset" type="button" class="btn btn-success">Reset</button>
</td>
</tr>
</tbody>
</table>
</form>
的CSS部件显示被选中的单选按钮后立即跨越。我不想那 – UPSCFever
那么你想要什么?延迟后显示它?淡入? – elementzero23
只是想澄清,所以你想要的是当你点击提交按钮时,你想要显示''glyphicon-ok'和'.glyphicon-remove'类的'span'元素? – prtdomingo