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

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

假設jquery不包含某個類,如下內容該怎么解決?

假設jquery不包含某個類,如下內容該怎么解決?

喵喵時光機 2022-02-11 17:07:22
jquery不包含某個類比如說現在我有<ul id="main"><li class="one"></li><li class="one two">XX</li><li class="one">XX</li><li class="one">XX</li></ul>我想選擇只有one這個類的所有li,不選擇有one two 這兩個類的li。這是一個導航條。two這個類不是一直待在第二li 的不好意思忘記了,如果沒有one,如下應該如何選擇<ul id="main"><li></li><li class="two">XX</li><li>XX</li><li >XX</li></ul>
查看完整描述

2 回答

?
慕運維8079593

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

Js代碼  

1 、$('li').not(':even').css('background-color', 'red');  


    Js代碼  

    1、 $('li').not(document.getElementById('notli'))  

    2  、 .css('background-color', 'red');  


    Js代碼  

    1、 $("div").not(".green, #blueone")  

    2 、          .css("border-color", "red");  


    Js代碼  

    1 、Example: Removes the element with the ID "selected" from the set of all paragraphs.  


    2、 $("p").not( $("#selected")[0] )  。

    3 、Example: Removes the element with the ID "selected" from the set of all paragraphs.  


    4 、$("p").not("#selected")  。

    5 、Example: Removes all elements that match "div p.selected" from the total set of all paragraphs.  


    6 、$("p").not($("div p.selected"))  。


    Js代碼  

    1、 $("#reset").click(function() {  。

    2 、  $(':input','#fundingpossibility')  。


查看完整回答
反對 回復 2022-02-14
?
千巷貓影

TA貢獻1829條經驗 獲得超7個贊

$("li[class='one'][class!='two']")

查看完整回答
反對 回復 2022-02-14
  • 2 回答
  • 0 關注
  • 334 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

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

幫助反饋 APP下載

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

公眾號

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