분류 전체보기 154

HTML in JS

const text = document.getElementById -> id로 찾아서 값출력 document.getElementsByClassName ->claa로 찾아서 값출력 text.innerText="" //innerText를 이용해서 값을 변화시킬 수 있다. getElementById() getElementsByClassName() getElementsByTagName() 이렇게 자바스크립트를 통해 HTML을 가져올 수 있는 것이 크게 세가지 있음 이중에서 querySelector를 가장 많이 쓸 것임 getElementById() : 말 그대로 id , 하나의 값을 반환해줄때 쓴다 getElementsByClassName() : 클래스 네임을 가져옴, array에 할당 getElementsBy..

JavaScript 2021.12.22

js 데이터타입

[데이터타입] var 은 더이상 쓰지 않는다. 선언하기도 전에 사용 가능함, 블럭 선언을 무시한다. var hoisting 어디다 선언하든 항상 제일 위로 선언을 올려준다. let 사용! (Mutable) const (Immutable) const 한번 할당하면 값이 변하지 않는다. 보안성이 좋다 한번 선언하고 변경될 일이 없다면 const로 선언하는게 좋다. variable types primitive(single item) : number, string, boolean, null, undefiedn, symbol object, box container

JavaScript 2021.12.08

flex box

float - 이미지와 텍스트를 지정 float : left - 사진이 왼쪽에 배치된고 글이 감싼다. float : center - 사진이 가운데에 배치된고 글이 감싼다. float : right - 사진이 오른쪽에 배치된고 글이 감싼다. display display:flex -> box들이 세로에서 가로로 바뀜 flex flex-direction:row; 왼쪽에서 오른쪽 flex-direction:row-reverse; 오른쪽에서 왼쪽 flex-direction:column; 위에서 아래로 flex-direction:column-reverse; 아래에서 위로 flex-wrap : nowrap; - 한줄에 아이템이 많아도 붙어있다. flex-wrap : wrap; - 한줄에 아이템이 꽉차면 다음줄로 넘어..

CSS 2021.12.07

display, position

display display : block; --블럭단위로 한줄에 하나 display : inline; --안에 들어가 있는 물건의 크기에 따라 변경 display : inline-block; --한줄에 여러개가 들어가지만 블럭 사이즈이다. position default position : static; position : relative; //원래 있던 자리에서 움직임 position : absolute; //내 아이템과 가장 가까이 있는 부모로 이동 position : fixed; //윈도우 안에서 움직임 position : sticky; //원래 그 자리에 있는데 스크롤 하면 화면에 계속 남는다.

CSS 2021.12.06

js 코딩테스트 기본

Number.MAX_SAFE_INTEGER - 최대정수 Number.MIN_SAFE_INTEGER - 최소정수 Math.min(3,5,7) - 최소값 구하기 Math.ceil - 올림 Math.floor - 내림 Math.round - 반올림 Math.sqrt - 제곱근 Math.min(...arr) - 전개연산자 --> (arr[0],arr[1] ...) 이런식으로 들어간다 Math.min.apply(null,arr) 첫번째는 객체 두번째는 배열 //forEach, map, filter, reduce //forEach a=[10, 11, 12, 13, 14, 15]; a.forEach(function(v, i) { //for 대신 사용 //첫번째는 값 두번째는 인덱스번호 console.log(v, i,..

코딩테스트 2021.12.06