본문 바로가기
반응형

제리쿼리5

JQuery 탐색 탐색 체인 컨텍스트를 유지하면서 제어의 대상이 되는 엘리먼트를 변경하는 기법이다. ${'#root}.addclass{'s'}.removeClass{'s'}.add('s').addclass{'s'}.removeClass{'s'}.first{'s'}........ 위의 예시처럼 계속 체인처럼 연결하여 탐색을 계속 코딩할 수 있다. .add(selector) : 엘리먼트를 추가한다 .andSelf() : 현재 엘리먼트 셋에 이전 엘리먼트 셋을 더 한다 .children([selector]) : 자식 엘리먼트를 선택한다 .closest(selector) : 가장 가까운 selector 조상 엘리먼트를 탐색한다 .each(function(index,Element)) : 현재 엘리먼트 셋에 반복 작업을 실행한다 ... 2020. 12. 30.
JQuery 폼 폼 서버로 데이터를 전송하기 위한 수단 JQuery는 폼을 제어하는데 필요한 이벤트와 메소드를 제공한다. JQuery 폼 API 문서 : http://api.jquery.com/category/forms/ Forms | jQuery API Documentation Bind an event handler to the “blur” JavaScript event, or trigger that event on an element. Bind an event handler to the “change” JavaScript event, or trigger that event on an element. Bind an event handler to the “focus” JavaScript event, or tr api.j.. 2020. 12. 29.
JQuery 엘리먼트 제어 엘리먼트 제어 jQuery는 엘리먼트를 제어하는 일관되고 풍부한 기능들을 제공한다. http://api.jquery.com/category/manipulation/ Manipulation | jQuery API Documentation Adds the specified class(es) to each element in the set of matched elements. Insert content, specified by the parameter, after each element in the set of matched elements. Insert content, specified by the parameter, to the end of each element in the set of api.jquer.. 2020. 12. 28.
JQuery 선택자 선택자란? jQuery wrapper에는 CSS 선택자가 위치할 수 있는데, 이를 통해서 제어하려는 엘리먼트를 빠르고 정확하게 지정할 수 있다. 예제 코드 - id 선택자 : #선택자 - class 선택자 : .선택자 - 엘리먼트 선택자: 엘리먼트 자체 - 다중 선택자 : #선택자, #선택자2 아래 코드에서 JQuery을 이용하여 선택자를 불러오는 것을 확인 할 수 있다. 아래 jQuery 사이트에서 더 다양한 선택자를 찾아볼 수 있다. 활용할 수 있는 이해만 하면 선택자를 다 외우지 못하도 활용할 수 있다. https://api.jquery.com/category/selectors/ Selectors | jQuery API Documentation Select all elements that are i.. 2020. 12. 22.
javascript Element 객체 - jQuery 속성 제어 API jQuery 속성 제어 API Element의 API에 해당하는 기능을 jQuery에서는 어떻게 구사 가능하다. 속성제어 jQuery 객체의 메소드 중 setAttribute, getAttribute에 대응되는 메소드는 'attr'이다. 또한 removeAttribute에 대응되는 메소드로는 'removeAttr'이 있다. 블로그 attribute와 property DOM과 마찬가지로 jQuery도 속성(attribute)과 프로퍼티를 구분한다. 속성은 attr, 프로퍼티는 prop 메소드를 사용한다. URL jQuery를 이용하면 프로퍼티의 이름으로 어떤 것을 사용하건 올바른 것으로 교정해준다. 이런 것이 라이브러리를 사용하는 의의라고 할 수 있다. ↓ jin seok 2020. 11. 19.
반응형