※ doubleclick() 사용
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script>
$(document).ready(function(){
// p tag를 double click하면, p tag가 화면에서
// 사라지게 하게 할려면?
$("p").dblclick(function(){
$(this).hide();
});
});
</script>
</head>
<body>
<p>If you double-click on me, I will disappear.</p>
<p>Click me away!</p>
<p>Click me too!</p>
<h3>this is h3</h3>
<h4>this is h4</h4>
</body>
</html>
※ 실행화면
'jQuery 수업' 카테고리의 다른 글
jQuery-6(이벤트 fadeIn(), fadeOut(), fadeTo(), fadeToggle()) (0) | 2020.02.19 |
---|---|
jQuery-5(이벤트 toggle) (0) | 2020.02.19 |
jQuery-4(이벤트 hide(), show()) (0) | 2020.02.19 |
jQuery-3(마우스 이벤트, mouseenter, mouseleave, mousedown, mouseup) (0) | 2020.02.19 |
jQuery -1(클릭) (0) | 2020.02.19 |