tech stacks/JS
-
간단하게 설명을 위한 예제만 참고되어 있을 수 있으며, 해당 메서드에 대한 자세한 기능들은 아래 사이트를 활용하시면 좋을 것 같습니다. https://developer.mozilla.org/ko/ MDN Web Docs The MDN Web Docs site provides information about Open Web technologies including HTML, CSS, and APIs for both Web sites and progressive web apps. developer.mozilla.org join() 배열의 모든 요소 합치기 join() 메서드는 배열의 모든 요소를 연결해 하나의 문자열로 만든다 예제) const elements = ['Fire', 'Air', 'Water'];..
자주 활용되는 js 메서드 모음 (설명있음!)간단하게 설명을 위한 예제만 참고되어 있을 수 있으며, 해당 메서드에 대한 자세한 기능들은 아래 사이트를 활용하시면 좋을 것 같습니다. https://developer.mozilla.org/ko/ MDN Web Docs The MDN Web Docs site provides information about Open Web technologies including HTML, CSS, and APIs for both Web sites and progressive web apps. developer.mozilla.org join() 배열의 모든 요소 합치기 join() 메서드는 배열의 모든 요소를 연결해 하나의 문자열로 만든다 예제) const elements = ['Fire', 'Air', 'Water'];..
2024.04.10 -
깃허브 : https://github.com/cheryea/personal-study/issues?q=is%3Aopen+is%3Aissue+label%3AJavaScript 변수 var ul=document.querySelectorAll('.ul'); 토글방식으로 클래스 주기 document.getElementById(' ').classList.toggle(' '); 스타일 속성 변경 document.getElementById(" ").style.display = " "; 클래스 주기 document.getElementById(" ").className = " "; 클래스 빼기 변수.classList.remove(' '); 클래스 주기 ( 클래스 여러개 주기 가능 ) 변수.this.classList.ad..
JS 메모깃허브 : https://github.com/cheryea/personal-study/issues?q=is%3Aopen+is%3Aissue+label%3AJavaScript 변수 var ul=document.querySelectorAll('.ul'); 토글방식으로 클래스 주기 document.getElementById(' ').classList.toggle(' '); 스타일 속성 변경 document.getElementById(" ").style.display = " "; 클래스 주기 document.getElementById(" ").className = " "; 클래스 빼기 변수.classList.remove(' '); 클래스 주기 ( 클래스 여러개 주기 가능 ) 변수.this.classList.ad..
2022.09.04 -
선택 된 여러 요소들은 배열로 정의됩니다. 예시 HTML의 태그 여러개를 모두 선택합니다. var matches = document.querySelectorAll("p"); 태그의 css클래스명중 note, alert 을 선택합니다. var matches = document.querySelectorAll("div.note, div.alert"); ID #test를 선택합니다. 선택한 ID가 들어있는 변수를 불러올 수 있습니다. 변수안의 선택된 ID중의 div 태그 클래스명을 선택해서 그 안의 요소인 태그를 선택합니다. var container = document.querySelector("#test"); var matches = container.querySelectorAll("div.highlighte..
Document.querySelectorAll() - 여러 요소 선택선택 된 여러 요소들은 배열로 정의됩니다. 예시 HTML의 태그 여러개를 모두 선택합니다. var matches = document.querySelectorAll("p"); 태그의 css클래스명중 note, alert 을 선택합니다. var matches = document.querySelectorAll("div.note, div.alert"); ID #test를 선택합니다. 선택한 ID가 들어있는 변수를 불러올 수 있습니다. 변수안의 선택된 ID중의 div 태그 클래스명을 선택해서 그 안의 요소인 태그를 선택합니다. var container = document.querySelector("#test"); var matches = container.querySelectorAll("div.highlighte..
2022.09.04