clickイベントが動かない jQueryのclickイベントを使っているとうまく動かないときがある。 元々存在するDOMにclickイベントを設定するときは、期待した通りに動くが、jQueryのappendメソッドなどで後から追加した要素にclickイベントを設定するとクリックをしているのに動かないことがあります。 そういうときは、onメソッドを使うと解決できるので、その方法をご紹介致します。 clickイベントが効かない NGパターン 生成したDOM要素にイベント設定する方法 clickイベントが効かない appendメソッドなどで、動的に要素を追加してその要素にclickイベントを設定しても、全く動かない。 調べてみると、jQueryには、イベントの記述方法が二つあったので、うまくいかない例とうまくいった例を紹介します。 NGパターン clickイベントを設定する簡単な方法は、cli