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.

[js]return falseについてメモ

Posted at

バブリング

HTML要素で子要素から親要素へイベントが伝播していくこと

下の例ではchild要素をクリックすると親要素のクリックイベントも発火する

<div id="parent" onClick="parentFunc()">
  <div id="child" onClick="childFunc()">
  </div>
</div>

簡単な対象法として jqueryのreturn false

htmlでonClickつけるのをやめて

$('#parent').click(function(){

 処理
 
});

$('#child').click(function(){
  処理
 return false;
});

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?