为什么这不起作用?当我更改并"$(this).toggleClass('checked');"
单击alert('test')
标签时,我会看到警报窗口:-/
$(document).ready(function(){
$("label").click(function(){
$(this).toggleClass('checked');
});
});
<input type="radio" name="hours" id="hours1" value="xyz" style="display: none" />
<label for="hours1">10:00</label>
<input type="radio" name="hours" id="hours2" value="xyz" style="display: none" />
<label for="hours2">11:00</label>