목록web (86)
Rainbow
id값이나 class 값을 사용해 폼 요소에 접근하기 -id값을 사용할 때는 폼 요소 하나에만 접근하고 -class값을 사용할 때는 여러 요소를 가져와 배열 형태로 저장 ex)예시문 id값 billingName인 요소를 찾아 소스를 표시할 것이다. document.querySelecter("#billingName") 텍스트 필드에 있는 값을 가져오기 위해서 텍스트 필드에 접근하는 소스 뒤에 value값을 붙여 쓴다. ex) document.querySelecter("#billingName").value = "한라산" name값을 사용해 폼 요소에 접근하기 - 폼 요소를 구별하고 접근할 수 있도록 HTML 초기부터 사용하던 방법 - form의 name값 부터 폼 요소의 name값까지 하나씩 지정한다. ex..
문서 객체 모델 정의 - Document Object Model을 줄여 DOM으로 표기 합니다. - 웹 문서의 모든 요소를 자바스크립트를 이용하여 조작할 수 있도록 객체를 사용해서 해석 해주는 방법 DOM을 사용하지 않고 상세 설명 가리기 ex) 상세설명 2차 세계대전 이후 설립된 개뎁 농장은 유기농 인증 농장으로 여성의 고용 창출과 지역사회 발전에 기여 하며 3대째 이어져 내려오는 오랜 역사를 가진 농장입니다. 게뎁 농장은 SCAA 인증을 받은 커피 품질관리 실험실을 갗추고 있어 철저한 관리를 통해 스페셜티 커피를 생산 합니다. = 상세 설명을 가릴 수 있다 DOM을 사용하여 상세 설명 가리기 ex)예시문 document.querySelecter("#detail h3").style.visibility ..
자바스크립트에서는 여러 개의 항목을 하나의 변수에 저장 한다. Arry 객체로 배열 만들기 자바스크립트 안에는 배열을 쉽게 만들고 다룰수 있게 미리 Arry객체가 만들어져 있습니다. Arry 객체를 사용해 인스턴스를 만든다. var myArry =new Arry( ); // Arry 객체 인스턴스를 만든다 var numbers =["one", "two", "three", "four"]; //리터럴을 사용한 배열 var numbers=new Arry("one", "two", "three", "four"); //Arry 객체를 사용한 배열 배열에서 for문 사용하기 - for문을 처음 요소부터 끝나는 요소까지 반복 합니다. - 배열에 몇 개의 요소가 있는지 확인 하려면 Arry객체의 length속성을 사용합..
함수를 정의하고 실행하기 함수선언 - 어떤 명령을 처리해야 할지 알려주는 것 함수실행 - 선언한 함수를 가져와 사용하는 것 함수호출 - 선언한 함수를 실행하기 위해서 이름을 사용하는 것 - 자바스크립트 소스안의 어디에서든 함수를 불러서 실행할 수 있다. 함수와 매개변수와 인수 소개 매개변수 - 함수를 실행하기 위해 필요하다고 지정하는 값 function( a,b ){ 함수 선언후 변수 add에 할당한다. return = a + b; } 변수 add를 사용해 익명함수를 실행한다 그 결과값을 변수에 저장한다. var sum = add(10, 20); sum 30 즉시 실행함수 - 함수를 선언하고 동시에 실행하는 함수 입니다. - 변수에 할당할 수 있다. ex) (function( ){ ..............
객체란? - 숫자, 문자열등을 포함하고 있는 복합자료형 이라고 한다 - 자바스크립트에서 객체는 저장하고 처리하는 기본 단위 복합자료형이란? - 하나의 변수에 다양한 정보를 담기 위해 사용하는 자료형 내장객체 - 자바스크립트 안에서 미리 만들어진 객체 문서 객체 모델(DOM) - 웹 문서 안에 포함된 이미지, 링크 , 텍스트 필드 각각 별도로 미리 만들어진 객체 문서를 담는 Document객체 이미지를 관리하는 Image객체 브라우저 객체 모델(BOM) - 웹 브라우저의 주소 표시줄이나 창 크기등 브라우저 정보를 객체로 다룬다. 브라우저 종류나 버전을 담고 있는 Navigatior객체 방문 기록을 남기는 history객체 주소 표시줄 정보를 담고 있는 Location객체 화면크기 정보가 들어 있는 scre..
percent 부모 요소의 width에 상대적인 크기를 지정합니다. width는 content 영역의 너비를 제어할 때 사용하는데 이때 auto가 아닌 특정한 값을 지정하여 사용하면, 그 크기는 box model 영역에서 margin 영역을 제외한 모든 영역에 대해 영향을 받습니다. (content, padding, border) 예를 들어, .box { width: 100px; padding: 20px; border: 10px solid black; } 100px content + ( 20px * 2) padding + ( 10px * 2 ) border = 160px 가 된 것입니다. 또한, width는 %를 이용해서도 크기를 지정할 수 있습니다. .parent { width: 300px; borde..