我有一些無線電輸入。請參閱代碼如何使選定的收音機輸入不是多個
<div class="radio">
<label class="btn btn-time text-center "> 9.30 PM
<input type="radio" name="optionsRadios"id="optionsRadios20"value="9.30PM" />
</label>
</div>
有很多這樣的輸入。我想在用戶點擊一個輸入時添加選定的顏色。爲此,我正在使用這個jQuery代碼
$(document).ready(function() {
$(".btn-time").click(function(){
$(this).css("background", "#DF73AF");
});
});
此代碼解決了問題,但問題是,它給所有點擊輸入相同的顏色。我只想要最後點擊的輸入顏色和其他應該返回到默認值。 在此先感謝..
謝謝你soo ..工作完美..我接受你的問題,因爲你先回答.. –