:input

尋找所有 input, textarea, select 和 button 元素。

傳回值

Array<Element>

範例

尋找所有的input元素。

HTML 代碼:

<form>
  <input type="text" />
  <input type="checkbox" />
  <input type="radio" />
  <input type="image" />
  <input type="file" />
  <input type="submit" />
  <input type="reset" />
  <input type="password" />
  <input type="button" />
  <select><option/></select>
  <textarea></textarea>
  <button></button>
</form>

jQuery 代碼:

$(":input")

結果:

[ <input type="text" />, <input type="checkbox" />, <input type="radio" />, <input type="image" />, <input type="file" />, <input type="submit" />, <input type="reset" />, <input type="password" />, <input type="button" /> ]

arrow
arrow
    全站熱搜

    mitblog 發表在 痞客邦 留言(0) 人氣()