JQuery each attr 基本用法總結

2021-07-25 02:26:35 字數 612 閱讀 3928

具體用法

var $cat= $("select[id^='cat']");

$cat.each(function(i)

});

獲取以input 框id以cat打頭的集合並迴圈,i是迴圈的下角標(0,1,2...),

$(this)當前迴圈的物件,$(this).val()當前物件input框裡的值,

$(this).focus()獲取當前物件焦點,

例如:id=「cat1「

$(this).attr("id").substr(3),這個就是擷取當前id=cat後面的字元1。

拓展:

例如:

1.$(selector).attr(attribute,value)

設定img這個的寬度為25,

$("img").attr("width",25)

2.$(selector).attr(attribute)

返回img這個的寬度,

$("img").attr("width")

3.$(selector).attr()

為這個設定多個屬性/值對$("img").attr();

Optimized Purchasing基礎知識

pr的三要素 物料 數量 採購日期 日期是會影響價錢的 blanket po fo框架訂單。a 成本中心,i 限制 專案的限制標籤 miro支票不管數量,從帳戶分配輸入金額。產生pr三種 me51n,me25,mrp 產生po四種 me21n,me25,me57,me59n evo 物料管理 採購 ...

Phabricator Arcanist基本用法

git clone git git clone git 獲取到arcanist的原始碼後,進行相關配置 開啟.bash profile open e bash profile在環境變數中新增 export path path somewhere arcanist bin 命令列中輸入arc命令檢視是...

HttpServletResponse基本功能

request是請求物件,而response是響應物件。response物件的功能分為以下四種 設定響應頭資訊 addheader refresh 5 url x 傳送狀態碼 senderror 404 設定響應正文 getwriter print fdsfdsa 重定向 sendredirect ...