같은 폴더안에 tab.js 를 만들었고
입력했고
<script src="tab.js"></script>
tab.js 안에
$('.tab-button').eq(0).on('click',function(){
$('.tab-button').removeClass('orange')
$('.tab-button').eq(0).addClass('orange')
$('.tab-content').removeClass('show')
$('.tab-content').eq(0).addClass('show')
});
잘넣었는데 오류가 뜹니다 ...
J쿼리 문제인가 싶어서 디테일 html 파일안에 제이 쿼리를 삭제했따 넣어봤다 했는데 해결이안됩니다 ㅜㅜ
ERROR: '$' is not defined. [no-undef]
$('.tab-button').eq(0).on('click',function(){
4
ERROR: '$' is not defined. [no-undef]
$('.tab-button').removeClass('orange')
5
ERROR: '$' is not defined. [no-undef]
$('.tab-button').eq(0).addClass('orange')
6
ERROR: '$' is not defined. [no-undef]
$('.tab-content').removeClass('show')
7
ERROR: '$' is not defined. [no-undef]
$('.tab-content').eq(0).addClass('show')
JSLint (10)
3
'$' was used before it was defined.
$('.tab-button').eq(0).on('click',function(){
3
Missing space between ',' and 'function'.
$('.tab-button').eq(0).on('click',function(){
3
Expected exactly one space between 'function' and '('.
$('.tab-button').eq(0).on('click',function(){
3
Expected exactly one space between ')' and '{'.
$('.tab-button').eq(0).on('click',function(){
3
Missing space between ')' and '{'.
$('.tab-button').eq(0).on('click',function(){
4
Missing 'use strict' statement.
$('.tab-button').removeClass('orange')
4
Expected ';' and instead saw '$'.
$('.tab-button').removeClass('orange')
5
Expected ';' and instead saw '$'.
$('.tab-button').eq(0).addClass('orange')
6
Expected ';' and instead saw '$'.
$('.tab-content').removeClass('show')
7
Expected ';' and instead saw '}'.
$('.tab-content').eq(0).addClass('show')