• 카테고리

    질문 & 답변
  • 세부 분야

    웹 개발

  • 해결 여부

    미해결

제이쿼리 작성시 함수에 줄이 생기는 부분

22.04.29 12:00 작성 조회수 207

1

안녕하세요 수업 잘 듣고 있습니다.

포트폴리오 실전 1의 제이쿼리 기초강좌 듣는 중인데

.click 이라던지 .mouseenter 라던지 하는 함수를 적을 때 해당 글자에 줄이 생기더라구요.

첨부한캡쳐 처럼요.

구현하는데 문제는 없습니다. 입력한대로 화면에는 잘 나오는데

저렇게 줄이 그어져 있으니까 제가 뭔가 잘못 입력한 건가 싶어서요.(아시겠지만 비주얼스튜디오코드 쓰고 있습니다.)

--------html 소스코드

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
a{
display: inline-block;
color: #000;
text-decoration: none;
background-color: #ddd;
width: 100px;
text-align: center;
padding: 5px;
}
div{
background: blue;
height: 200px;
margin-top: 10px;
width: 230px;
color: #fff;
line-height: 200px;
text-align: center;
display: none;
}
</style>
</head>
<body>
<a href="#" class="show-btn">보이기</a>
<a href="#" class="hide-btn">감추기</a>
<div>Box</div>
 
<script src="script/jquery-1.12.4.js"></script>
<script src="script/custom.js"></script>
</body>
</html>

-------제이쿼리 코드 (파일명 custom.js)

$('.show-btn').click(function(){
$('div').show()
});

$('.hide-btn').click(function(){
$('div').hide()
});

답변 1

답변을 작성해보세요.

0

click 부분을 이벤트 핸들러라 부르는데 저는 저렇게 취소선이 들어간건 경험이 없어요.

구글링해봐도 단서를 찾을 수가 없네요.

이런 말하기는 그렇지만 곧 없어지거나 아니면 다시 설치해보시는게 어떨까 합니다.

도움이 안되었네요.