자바스크립트6 자바스크립트 /value, textContent , innerHTML, innerText 사용 innerHTML 1. Element속성으로 해당 Element의 HTML, XML을 읽어오거나, 설정할 수 있다. ============================ innerText 1. Element내에서 사용자에게 보여지는 텍스트 값을 읽어옴 2. 연속된 공백은 무시하고 하나의 공백만 처리 =========================== textContent 1. textContent는 'Node'의 속성 2. 해상 노드가 가지고 있는 텍스트 값을 그대로 읽는다. 3. 연속된 공백을 그대로 표현 ============================ // 무언가를 입력하는 것들은 대부분 value를 사용한다. input / value select / value textarea / value // t.. 2023. 4. 18. 자바스크립트 배열 (JAVASCRIPT ARRAY) const color = ['red', 'blue', 'orange', 'yellow', 'green']; console.log(color[0]) // 배열의 0번째 인덱스를 콘솔에 띄워줌 // red color.length; // 배열의 요소 개수 알려줌 // 5 color[5] = 'apple'; // color = ['red', 'blue', 'orange', yellow', 'green', 'apple'] color.shift(); // 배열의 맨 처음 값을 제거해줌 //color = [blue', 'orange', yellow', 'green', 'apple'] color.unshift('red'); // 배열의 맨 앞에 'red'를 넣어줌 //color = ['red', 'blue', 'ora.. 2023. 4. 18. 이전 1 2 다음