亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

css的設置沒有起作用?

css的設置沒有起作用?

倚天杖 2018-09-02 07:55:27
hobby:<input id="x1" type="radio" name="sports" />x1<input id="x2" type="radio" name="sports" />x2<input id="x3" type="radio" name="sports" />x3<input type="button" value="顯示" onclick="ShowChecked()"><br><script> function ShowChecked(){     $("input").css("backgroundColor","");     $("input:checked").css("backgroundColor","red"); }     </script>選擇某個radio后,點擊 顯示 ,背景顏色沒有變紅哈?
查看完整描述

2 回答

?
慕斯709654

TA貢獻1840條經驗 獲得超5個贊

選擇器沒問題,問題出現在input[type=radio]的背景顯示不了,或者說設置不了背景

你可以設置一下margin試試

function ShowChecked(){
    $("input").css("backgroundColor","");
    $("input:checked").css("margin","100px");
}


查看完整回答
反對 回復 2018-09-02
?
拉風的咖菲貓

TA貢獻1995條經驗 獲得超2個贊

<input type="button" value="顯示" onclick="ShowChecked">


查看完整回答
反對 回復 2018-09-02
  • 2 回答
  • 0 關注
  • 940 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號