오전9시 :
<script type="text javascript">
</script>
document.write(1+1); <=====
alert('Hello world'); <=====경고창
console.log('console hello'); <=====디버깅 체크,
==================출력===================
<input type="button" value="버튼이야" onclick="alert('나 경고창임')">
오전10시 :
<!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>경일아카데미</title>
<script type="text/javascript">
/*
변수타입
-->숫자형 : int
-->글자형 : String
True or False : Boolean 값으로 나옵니다.
*/
ingoo = 40; /*숫자형*/ /*대입 연산자*/
ingoo2 = '40'; /*문자형*/
document.write(1+1);
alert('Hello world');
console.log('console hello');
console.log(ingoo);
console.log('ingoo'); /* '' <---안에 있는것은 변수가 아니고 문자열이다*/
console.log(ingoo+ingoo2); /* 변수끼리 서로 더할 수 있다.*/ /* + 는 연산자*/
/* 조건문 if문 */
if(ingoo == 40) { /* True */ /* 프로그래밍에선 같은값을 물어볼때는 ==을 쓴다 */
console.log('맞습니다.');
} else {
console.log('틀렸습니다.');
}
/* 비교문 */
ingoo2=10;
ingoo3=10;
console.log(ingoo2==ingoo3); /* True */
result = ingoo2 == ingoo3;
console.log(result);
result2 = ingoo2 < ingoo3; /* false */
console.log(result2);
/* =가 가장 나중에 계산된다. == */
/* 반복문
ingoo = 0;
ingoo < 10;
ingoo + 1;
*/
/* 반복문 실습 */
for(i=1; i<=9; i++){
console.log('2*'+i+'='+2*i);
}
</script>
</head>
<body>
<h2>1+1</h2>
<input type="button" value="버튼" onclick="alert('나 경고창임')">
</body>
============================================================================
<!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>
</head>
<body>
<div id="root">hello, world</div>
<input type="button" value="버튼" onclick = "changeColor();"> <!--html 형식에 java를 넣어주기위해(동적인 효과)-->
<script type="text/javascript">
/*css처럼 java기능어 중에 하나... */
function changeColor(){ /* <========사용자가 직접 만든 함수 ,,, css처럼 재사용하기 위해서 */
ele = document.querySelector('#root');
ele.style.color = 'red';
}
</script>
<!--
() = 함수 다른말로 매서드
'=' = 속성
-->
<!--
str = 'urlimagesmainnewmainconic01pngbottomrightnorepeat'
console.log(str.length);
-->
<!--
<str>
<length></length>
</str>
<document>
<querySelector></querySelector>
</document>
/* 구버전.... ele = document.getElementById('root'); */
-->
</body>
</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>
body{
background: #fff;
color:black;
}
</style>
</head>
<body>
<h1>안녕하세요</h1>
<input type="button" value="밝게" onclick="changecolor2();">
<input type="button" value="어둡게" onclick="changecolor();">
<ul>
<li><a href="##">메뉴1</a></li>
<li><a href="##">메뉴2</a></li>
<li><a href="##">메뉴3</a></li>
</ul>
<p>
vr/ar 1기 김상균"경일은 교수님들도 잘 <br>
가르쳐주시고 제가 초조해지거나 의욕이 <br >
꺾이지 않게분위기를 다잡아주셔서 공부가 <br>
더 잘 되었던 것 같습니다. "카카오게임즈 대표작 : ... <br>
감상균 취업자
</p>
<script type="text/javascript">
function changecolor(){
elem = document.querySelector('body');
elem.style.background = '#000';
elem.style.color = '#fff';
}
function changecolor2(){
elee = document.querySelector('body');
elee.style.background = '#fff';
elee.style.color = '#000';
}
</script>
</body>
</html>