Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 | 31 |
Tags
- module wrapper function
- regExp
- flexbox
- flex-shrink
- express-handlebars
- JS
- Prototype
- 디자인패턴
- Object.create
- ajax
- css grid
- css variables
- css 오버레이
- img 확대
- close together
- Sass
- flex-grow
- Node.js
- css
- 정규표현식
- improve-iq-by-up-to-10%!
- es6
- Engoo
- flex-basis
- select by attribute
- Express
- just-one-small-sip
- 무료 백엔드 배포
- node
- shit-christmas
Archives
- Today
- Total
Document Object 본문
HtmlCollection이 Array가 아님에 주의
let val;
val = document;
val = document.all; // htmlcollection
val = document.all[1]; // can access by indexes
val = document.all.length;
val = document.head;
val = document.body;
val = document.doctype;
val = document.domain;
val = document.URL;
val = document.characterSet;
val = document.contentType;
val = document.forms;
val = document.forms[0];
val = document.forms[0].id;
val = document.forms[0].method;
val = document.forms[0].action;
val = document.links;
val = document.links[0];
val = document.links[0].id;
val = document.links[0].className;
val = document.links[0].classList[0];
val = document.images;
val = document.scripts;
val = document.scripts[2].getAttribute("src");
let scripts = document.scripts;
let scriptsArr = Array.from(scripts); // way to array
scriptsArr.forEach((script) => {
console.log(script.getAttribute("src"));
})
console.log(val);
'2021 프론트 엔드 로드맵 따라가기 > JS' 카테고리의 다른 글
Multiple Selector (0) | 2021.05.30 |
---|---|
single selector (0) | 2021.05.30 |
Variable Scope (0) | 2021.05.30 |
Math Object (0) | 2021.05.29 |
Type Conversion (0) | 2021.05.29 |
Comments