jQuery [attribute!=value]
此選擇器匹配所有不存在指定屬性,或者屬性不等於特定值的元素。
jQuery1.0版本新增。
語法結構:
[JavaScript] 純文字檢視 複製程式碼jQuery( "[attribute!='value']" )
引數解析:
(1).attribute:一個屬性名。
(2).value:一個屬性值,可以是一個有效識別符號或帶一個引號的字串。
程式碼例項:
[HTML] 純文字檢視 複製程式碼執行程式碼<!DOCTYPE html> <html> <head> <meta charset=" utf-8"> <meta name="author" content="http://www.softwhy.com/" /> <title>螞蟻部落</title> <script src="http://code.jquery.com/jquery-latest.js"></script> <script type="text/javascript"> $(document).ready(function(){ $("#bt").click(function(){ $("li[title!=ant_2]").css("color", "blue"); }); }); </script> </head> <body> <ul> <li title="ant_1">螞蟻部落一</li> <li title="ant_2">螞蟻部落二</li> </ul> <input type="button" value="檢視效果" id="bt" /> </body> </html>
將title屬性值不為"ant_2"的li元素字型顏色設定為藍色。
相關文章
- jQuery [attribute*=value]jQuery
- jQuery [attribute~=value]jQuery
- jQuery [attribute|=value]jQuery
- jQuery [attribute$=value]jQuery
- jQuery [attribute^=value]jQuery
- jQuery [attribute=value]jQuery
- jQuery [attribute]jQuery
- ERROR getting 'android:label' attribute: attribute is not a string valueErrorAndroid
- According to TLD or attribute directive in tag file, attribute value does not accept any expressionExpress
- Truncating HTML attribute value in SharePoint DataFormWebPartHTMLORMWeb
- get_attribute ('textContent') 和 get_attribute ('value') 有什麼區別
- The value for the useBean class attribute SecurityOrgPages is invalid. in tomcat 5.5BeanTomcat
- According to TLD or attribute directive in tag file, attribute value does not accept any expressions報錯解決辦法Express
- 使用JSTL庫的時候: According to TLD or attribute directive in tag file, attribute value does not accept anyJS
- An invalid XML character (Unicode: 0x10) was found in the value of attributeXMLUnicode
- jQuery - remove select option based on text not valuejQueryREM
- jquery value的不一般jQuery
- PHP 對字串進行十六進位制替換 invalid character in attribute valuePHP字串
- Error: Attribute application@label value=(@string/appname) from AndroidManifestErrorAPPAndroid
- jquery獲取同一name的input的value值jQuery
- 使用jQuery獲取iframe元素的value屬性值jQuery
- jQuery使用val()方法設定或者獲取value值jQuery
- JQuery 獲取select被選中的value和textjQuery
- jquery獲取struts2標籤 裡的key valuejQuery
- jquery獲取select下拉選中option項的value值jQuery
- SpringBoot升級到3.2.0報錯Invalid value type for attribute ‘factoryBeanObjectType‘: java.lang.StringSpring BootBeanObjectJava
- Attribute Checks
- 理解Spring MVC Model Attribute和Session AttributeSpringMVCSession
- jQuery操作select下拉框的text值和value值的方法jQuery
- jQuery實現的獲取select下拉選單的text和value值jQuery
- jquery實現的獲取select下拉選單value和文字內容jQuery
- C# 特性[Attribute]C#
- C#-特性(Attribute)C#
- 理解C# AttributeC#
- LOW_VALUE、HIGH_VALUE、ENDPOINT_VALUE轉換--UTL_RAW、DBMS_STATS.CONVERT_RAW_VALUE
- Process object has no attribute '_popen'Object
- ‘dict‘ object has no attribute ‘iteritems‘Object
- selenium get_attribute