Jam*_*ell 1 javascript jquery jquery-selectors
我有以下代码:
$('input[type="text"]').each(function(indx){
Run Code Online (Sandbox Code Playgroud)
目前,这允许访问类型为文本的输入,但如果我想访问type ="text"和type ="password"的输入,该怎么办?
我该如何设置?
你可以使用Multiple Selector,它只是逗号分隔选择器的一个奇特名称(与你在CSS中使用的相同):
$('input[type="text"],input[type="password"]').each(function(indx){
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
41 次 |
| 最近记录: |