ipsum image 사이트에서 이미지 찾기
css background image 태그 찾아 사용하면 레이어 표현도 가능
style 안의 태그를
style.css 파일에 붙여넣고
기존 자리에는 아래 링크 붙여넣기<link rel="stylesheet" href="style.css">
<script> 비교연산자
console.log(1<1);
console.log(1===1);
console.log(1!==1); (1과 1이 같지않으면)
</script>
<h1>Conditional Statements</h1>
<script>
console.log(1); 조건
if(true){
console.log('2 - true'); 맞으면 실행
} else {
console.log('2 - false'); 그 외는 실행안됨
}
console.log(3);
<script>
console.log(1);
for(let i=0; i<3 ;i=i+1){ 약속덩어리
console.log(2);
console.log(3);
}
console.log(4);
</script>
</script>
<h1>array+loop</h1>
<script>
var topics = ['html', 'css', 'js'];
for(let i=0; i<topic.length; (토픽의길이) i=i+1){
console.log('i=>',i);
}
document.write ('<li>'+topics[i]+'</li>'); (화면에나타남)
-> 리스트를 다 꺼내서 컴퓨터에게 처리를 위임
</script>
<script>
let input_id = prompt('아이디가?');
if(input_id === 'jiwon'){
alert(input_id+'님 반갑습니다');
}
else {
alert('누구세욘')
}
</script>
<input type="button" id="dnbtn" value="night" onclick="
let button = document.querySelector('#dnbtn')
if (button.value === 'night'){
document.querySelector('body').style.backgroundColor='black';
document.querySelector('body').style.color='white';
button.value = 'day';
} else {
document.querySelector('body').style.backgroundColor='yellow';
document.querySelector('body').style.color='black';
button.value = 'night';
}
">
여기서 = 는 동등하다는 의미가 아니다.
=== 가 동등하다는 의미.
조건문까지는 재미있고 간단해보였는데 ..
주말에 다시 복습 또 복습
if~else를 직접 적용해서 반응하는 버튼을 만든 것이 흥미로웠다.
쌩초보에게는 점점 어려워지는 것 같아서 잠시라도 눈을 떼면 안될 것 같다.
; { ( " ' 가 난무하는 스크립트를 보니 머리가 아파옴.