Ich habe eine Webseite mit 25 Q's. Und jeder hat 4 Optionen. Wenn der Benutzer auf die Schaltfläche klickt, sollte "Glyphicon-ok" angezeigt werden und "Glyphicon-Remove" neben den aktivierten Optionsfeldern sollte angezeigt werden. Wie es geht.Versteckte Anzeige neben dem aktivierten Optionsfeld anzeigen, wenn auf die Schaltfläche zum Senden geklickt wird
Was soll ich in unten Funktion hinzufügen.
$("#sub").click(function(){
});
Ich habe versucht, mit Hilfe von CSS
/*
.glyphicon-remove
{
display: none;
}
input:checked + span{
display: block;
}
*/
Meine 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>
den CSS-Teil zeigt umspannen unmittelbar nach Optionsfeld ausgewählt ist. Ich will das nicht – UPSCFever
Dann was willst du? Nach einer Verzögerung anzeigen? Einblenden? – elementzero23
Ich wollte nur klarstellen, also was willst du, wenn du auf den Submit-Button klickst, willst du das 'span'-Element anzeigen, das eine Klasse von' .glyphicon-ok' und '.glyphicon-remove' hat? – prtdomingo