일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 |
- css배경
- react
- CPU
- github 계정 두개 연결 (mac)
- typescript
- 이벤트
- 이벤트버블링
- 혼자 공부하는 컴퓨터구조+운영체제
- 코딩 자율학습 html + css + 자바스크립트]
- do it! 한권으로 끝내는 웹 기본 교과서 html+css+자바스크립트 웹 표준의 정석
- 코딩 자율학습 html + css + 자바스크립트
- css필수 속성
- 코딩
- 코딩자율학습
- 메모리와 캐시 메모리
- CSS
- Do it
- JS
- Git
- 비대칭키 암호화
- 자바스크립트
- cpu 성능 향상 기법
- css박스 모델
- 코딩 자율학습
- HTML
- propschildren
- TS
- https://api.jquery.com/
- 브라우저 렌더링 원리
- JavaScript
- Today
- Total
게으른 나에게
[JavaScript] 기본문법 본문
html 파일 안에 내용을 조작하는 방법.
<script> 태그 안에 자바스크립트 코드 작성.
[기본 문법]
셀렉터 : .getElementById()
메소드(함수): .innerHTML / .style / .color ..
document.셀렉터(' ').메소드(함수) = ' ';
<button onclick="document.getElementById(' ').style = '';">버튼</button>
getElementsByClassName('클래스명')[순서]
순서 반드시 작성 필요.
getElementsByTagName -> 태그명으로 찾아줌
getElementsByName -> name 속성으로 찾아줌
document.getElementsByClassName(' ')[0].style = ' ';
[function 문법]
긴 코드를 축약하고 싶을 때 사용
funcion 작명( ) {
실행할 코드
}
<button onclick="작명( )">버튼</button>
[function 파라미터]
funcion 작명( 내용 ) {
document.getElementById(' ').style = 내용;
}
작명('내용')
내용: 사용할 기능 적기
[이벤트 리스너]
document.getElementsById(' ')[0].addEventListener = ('기능', function( ) { 실행할 코드 });
이벤트 종류
https://developer.mozilla.org/en-US/docs/Web/Events
Event reference | MDN
Events are fired to notify code of "interesting changes" that may affect code execution. These can arise from user interactions such as using a mouse or resizing a window, changes in the state of the underlying environment (e.g. low battery or media events
developer.mozilla.org
'My Study > JavaScript' 카테고리의 다른 글
[JavaScript] - 문자 검사 (include, test) (1) | 2024.10.09 |
---|---|
[JavaScript] - setTimeout, setInterval (0) | 2024.10.07 |
[JavaScript] - 변수 (2) | 2024.10.04 |
[JavaScript] - form, 조건문 (0) | 2024.10.03 |
[JavaScript] Array.prototype.map() (0) | 2024.09.11 |