0
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 5 years have passed since last update.

attr prop removeAttrのこと

Last updated at Posted at 2019-04-15

jqの

attr は属性の値を取得。
prop は属性の値を取得。

removeAttrは属性を削除する。

細かくいうと、
attrは属性の値を取得。変更もできる。
propは、プロパティの真偽を返す。true/false (有効か無効か)
propは有効無効の切り替えができるもので、attrはその値を取るものだと思います。

なので、htmlのdisabled属性などは、attrで書き換えではなくpropで切り替えをした方がいいのではないかと思います。

覚書なので、他人がみたらわけわかめだと思いますね。。。

0
0
0

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
0
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?