Chciałbym wiedzieć, który element został kliknięty, aby zmienić jego klasę CSS. Oto kod:Uzyskaj kliknięty element w ButtonSet
<script type="text/javascript">
$(function() {
$("#radio").buttonset();
});
</script>
<div id="radio">
<input type="radio" id="radio1" name="radio" /><label for="radio1">Choice 1</label>
<input type="radio" id="radio2" name="radio" checked="checked" /><label for="radio2">Choice 2</label>
<input type="radio" id="radio3" name="radio" /><label for="radio3">Choice 3</label>
</div>
Co czyni tę część myśli: 'var $ element = $ (this); '? Czym różni się '$ element'? Co byś z tym zrobił? –
@jeffamaphone 'this' jest węzłem DOM. '$ (this)' jest obiektem jQuery, który zawiera węzeł DOM – BrunoLM