jQuery :disabled
此選擇器能夠選取所有禁用的表單元素。
jQuery1.0版本新增。
語法結構:
[JavaScript] 純文字檢視 複製程式碼jQuery( ":disabled" )
程式碼例項:
[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 () { $("input:disabled").css("background-color","red"); }); }); </script> </head> <body> <ul> <li> 不可用文字框:<input type="text" disabled="disabled" /> 可用的文字框:<input type="text"/> </li> </ul> <input type="button" value="檢視效果" id="bt" /> </body> </html>
點選按鈕可以將不可用按鈕背景色設定為紅色。
相關文章
- jQuery設定disabled屬性與移除disabled屬性jQuery
- jquery-disabled和readonlyjQuery
- jQuery中判斷input的disabled屬性jQuery
- <input> disabled
- CSSStyleSheet.disabled 屬性CSS
- 使用elasticsearch,Elasticsearch Scripts disabledElasticsearch
- Bootstrap下拉選單disabledboot
- Nessus提示API Disabled錯誤API
- readonly和disabled區別
- Error: php@8.0 has been disabled because it is a versioned formula! It was disabled on 2023-11-29.ErrorPHPORM
- SELinux has to be disabled on RHEL/OEL 5Linux
- Readonly和Disabled的區別
- disabled和readonly屬性區別
- CSS E:disabled偽類選擇器CSS
- CSS E:disabled 偽類選擇器CSS
- wordpress常用函式checked(),selected(),disabled()函式
- DedeCMS Error: Tag disabled: "php" 解決方法ErrorPHP
- 微信小程式改變 button disabled 樣式微信小程式
- How to Check whether SELinux is Enabled or Disabled [ID 432988.1]Linux
- disabled和readonly的區別是什麼
- input屬性disabled和readonly的區別(轉)
- 文字框的readonly和disabled屬性區別
- ORACLE 9i歸檔之ARCn: Media recovery disabledOracle
- Packet rejected remote IP proto TCP: Destination VIP disabledREMTCP
- Run the command with the repository temporarily disabled yum --disablerepo=zabbix ...
- Junit5系列-Junit5中@Disabled禁止執行
- 微信提現報錯:protocol is disabled or cipher suites are inapproprProtocolUIAPP
- <input>文字框的readonly和disabled屬性區別
- 標籤的readonly和disabled屬性的區別
- The partner transaction manager has disabled its support for remote/network transactions.REM
- MTTR advisory is disabled because FAST_START_MTTR_TARGET is not setAST
- 解決交換機埠出現err-disabled現象
- Vue 框架 使用 `:disabled` 屬性修改了原響應引數Vue框架
- Elasticsearch在進行聚合操作時提示Fielddata is disabled on text fields by defaultElasticsearch
- PHP Warning: exec() has been disabled for security 問題解決辦法PHP
- 動態設定元素的disabled屬性可用和不可用
- windows下curl報錯:curl : (1) Protocol https not supported or disabled in libcurlWindowsProtocolHTTP
- 開啟Android Studio報錯"required plugin “Android Support” is disabled"AndroidUIPlugin