2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

jQuery クラス名を指定して要素を取得する

Last updated at Posted at 2022-11-08

概要

  • クラス名を指定して要素を取得する方法をまとめる。

方法

  • html

    foo.html
    <input class="foo">
    <\input>
    
  • js

    foo.js
    $('.foo')
    

メモ

  • クラス名を使った要素の取得にはjQueryの$()メソッドを用いる。
  • $()メソッドの引数としてクラス名を渡すが、先頭に.をつけることを忘れずに

参考文献

2
0
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?