DRYな備忘録

Don't Repeat Yourself.

clickイベントが発生しない【jQuery】

【問題】

<script type="text/javascript">
  $("#test").click( function(){
    console.log("hoge");
  });
</script>

の、clickイベントが発生しない.

 

【原因】

直前のjQueryを読み込むためのscriptタグを、

<script src="jq/jquery-1.7.1.js"/>

としていたため.

 

【解決】

<script src="jq/jquery-1.7.1.js"></script>

とした.

 

 

jQuery レッスンブック jQuery2.X/1.X対応

jQuery レッスンブック jQuery2.X/1.X対応