Help us understand the problem. What is going on with this article?

iPhoneだけjQueryのセレクタでシンタックスエラーが出て死ぬ

More than 1 year has passed since last update.

コード

const name = $('[name="tag[Hoge][name]"]').val();
const address = $('[name="tag[Hoge][address]').val();

結果

2行目で死にます
2行目はセレクタの末尾に"]が足りません
PC, Androidだと何故か期待通りに動きます
iPhoneだとSafariでもChromeでも死にます

まとめ

罠にはまらないように、セレクタは一目で正しいと分かるものにしよう

Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away