LoginSignup
0
0

More than 1 year has passed since last update.

parameter 1 is not of type 'Node'

Posted at

実務でquerySelectorで最初のクラス要素を取得しようとしたらコンソールで以下のエラーが出た。

Uncaught TypeError: Failed to execute 'querySelector' on 'Node': parameter 1 is not of type 'Node'

例によってエラー文言で検索すると英語の記事が出てきた。
https://stackoverflow.com/questions/27079598/error-failed-to-execute-appendchild-on-node-parameter-1-is-not-of-type-no

存在しない要素を呼んでてnullが返ってるのだという。
確認すると後から追加された要素なのでDOMで取得できないのは当たり前だった。

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