어떻게

하우투 홈

메뉴

아이콘 바 메뉴 아이콘 아코디언 세로 탭 탭 헤더 전체 페이지 탭 호버 탭 상위 탐색 반응형 Topnav 아이콘이 있는 탐색 모음 검색 메뉴 검색 창 고정 사이드바 페이지 탐색 반응형 사이드바 전체 화면 탐색 캔버스 외 메뉴 호버 사이드 내비 버튼 아이콘이 있는 사이드바 가로 스크롤 메뉴 세로 메뉴 하단 탐색 반응형 하단 탐색 하단 테두리 탐색 링크 오른쪽 정렬 메뉴 링크 중앙 메뉴 링크 동일한 너비 메뉴 링크 고정 메뉴 스크롤 시 아래로 슬라이드 바 스크롤 시 Navbar 숨기기 스크롤 시 Navbar 축소 끈끈한 Navbar 이미지의 Navbar 마우스 오버 드롭다운 드롭다운 클릭 계단식 드롭다운 Topnav의 드롭다운 Sidenav의 드롭다운 Resp Navbar 드롭다운 하위 탐색 메뉴 드롭업 메가 메뉴 모바일 메뉴 커튼 메뉴 접힌 사이드바 접힌 측면 패널 쪽수 매기기 빵 부스러기 버튼 그룹 수직 버튼 그룹 스티커 소셜 바 알약 탐색 반응형 헤더

이미지

슬라이드쇼 슬라이드쇼 갤러리 모달 이미지 라이트박스 반응형 이미지 그리드 이미지 그리드 탭 갤러리 이미지 오버레이 페이드 이미지 오버레이 슬라이드 이미지 오버레이 줌 이미지 오버레이 제목 이미지 오버레이 아이콘 이미지 효과 흑백 이미지 이미지 텍스트 이미지 텍스트 블록 투명 이미지 텍스트 전체 페이지 이미지 이미지에 양식 영웅 이미지 배경 이미지 흐림 스크롤 시 Bg 변경 나란히 이미지 둥근 이미지 아바타 이미지 반응형 이미지 중앙 이미지 썸네일 이미지 주변 테두리 팀을 만나다 스티커 이미지 이미지 뒤집기 이미지 흔들기 포트폴리오 갤러리 필터링이 포함된 포트폴리오 이미지 줌 이미지 돋보기 유리 이미지 비교 슬라이더 파비콘

버튼

경고 버튼 개요 버튼 분할 버튼 애니메이션 버튼 페이딩 버튼 이미지의 버튼 소셜 미디어 버튼 더 읽기 덜 읽기 로딩 버튼 다운로드 버튼 알약 버튼 알림 버튼 아이콘 버튼 다음/이전 버튼 탐색의 추가 버튼 차단 버튼 텍스트 버튼 둥근 버튼 맨 위로 스크롤 버튼

양식

로그인 양식 가입 양식 결제 양식 문의 양식 소셜 로그인 양식 등록 양식 아이콘이 있는 양식 뉴스 레터 스택 형태 반응형 팝업 양식 인라인 양식 입력 필드 지우기 숫자 화살표 숨기기 클립보드에 텍스트 복사 애니메이션 검색 검색 버튼 전체 화면 검색 Navbar의 입력 필드 Navbar의 로그인 양식 사용자 정의 확인란/라디오 사용자 지정 선택 토글 스위치 체크박스 체크 Caps Lock 감지 입력 시 트리거 버튼 비밀번호 확인 비밀번호 가시성 전환 다단계 양식 자동 완성 자동 완성 끄기 맞춤법 검사 끄기 파일 업로드 버튼 빈 입력 유효성 검사

필터

필터 목록 필터 테이블 필터 요소 필터 드롭다운 정렬 목록 철자표

테이블

얼룩말 줄무늬 테이블 센터 테이블 전폭 테이블 나란히 놓인 테이블 반응형 테이블 비교표

전체 화면 비디오 모달 박스 모달 삭제 타임라인 스크롤 표시기 진행률 표시줄 스킬 바 범위 슬라이더 툴팁 디스플레이 요소 호버 팝 업 접을 수 있는 달력 HTML 포함 할 일 목록 로더 별점 매기기 사용자 평가 오버레이 효과 연락처 칩 카드 플립 카드 프로필 카드 제품 카드 경고 호출 노트 라벨 서클 스타일 HR 쿠폰 목록 그룹 글머리 기호 없는 목록 반응형 텍스트 컷아웃 텍스트 빛나는 텍스트 고정 바닥글 끈끈한 요소 동일한 높이 클리어픽스 반응형 플로트 스낵바 전체 화면 창 스크롤 그리기 부드러운 스크롤 그라디언트 Bg 스크롤 스티커 헤더 스크롤 시 헤더 축소 가격표 시차 종횡비 반응형 Iframe 좋아요/싫어요 전환 숨기기/표시 전환 다크 모드 전환 텍스트 토글 토글 클래스 수업 추가 수업 제거 활성 클래스 트리 뷰 속성 제거 오프라인 감지 숨겨진 요소 찾기 웹페이지 리디렉션 확대/축소 호버 플립 박스 수직으로 중앙 DIV의 가운데 버튼 마우스 오버 시 전환 화살표 모양 다운로드 링크 전체 높이 요소 브라우저 창 사용자 정의 스크롤바 스크롤바 숨기기 스크롤바 표시/강제 장치 모양 콘텐츠 편집 가능한 테두리 자리 표시자 색상 텍스트 선택 색상 총알 색상 수직선 분할기 애니메이션 아이콘 카운트 다운 타이머 타이프라이터 출시 예정 페이지 채팅 메시지 팝업 채팅 창 분할 화면 사용후기 섹션 카운터 인용 슬라이드쇼 닫을 수 있는 목록 항목 일반적인 장치 중단점 드래그 가능한 HTML 요소 JS 미디어 쿼리 구문 형광펜 JS 애니메이션 JS 문자열 길이 JS 지수 JS 기본 매개변수 현재 URL 가져오기 현재 화면 크기 가져오기 Iframe 요소 가져오기

웹사이트

무료 웹사이트 만들기 웹사이트 만들기 정적 웹사이트 만들기 웹사이트 만들기(W3.CSS) 웹사이트 만들기(BS3) 웹사이트 만들기(BS4) 웹사이트 만들기(BS5) 웹사이트 생성 및 보기 링크 트리 웹 사이트 만들기 포트폴리오 만들기 이력서 작성 레스토랑 웹사이트 만들기 비즈니스 웹사이트 만들기 웹북 만들기 센터 웹사이트 연락처 섹션 페이지 정보 큰 헤더 웹사이트 예시

그리드

2열 레이아웃 3열 레이아웃 4 열 레이아웃 그리드 확장 그리드 보기 나열 혼합 열 레이아웃 기둥 카드 지그재그 레이아웃 블로그 레이아웃

Google

구글 차트 구글 폰트 Google 글꼴 페어링 구글 애널리틱스 설정

변환기

무게 변환 온도 변환 길이 변환 속도 변환

블로그

개발자 취업 프론트엔드 개발자가 되십시오.

방법 - 자동 완성


자동 완성을 만드는 방법을 알아보세요.


자동 완성

입력 시작:



자동 완성 양식 만들기

1단계) HTML 추가:

예시

<!--Make sure the form has the autocomplete function switched off:-->
<form autocomplete="off" action="/action_page.php">
  <div class="autocomplete" style="width:300px;">
    <input id="myInput" type="text" name="myCountry" placeholder="Country">
  </div>
  <input type="submit">
</form>

2단계) JavaScript 배열 생성:

예시

전 세계 모든 국가의 배열:

var countries = ["Afghanistan","Albania","Algeria","Andorra","Angola","Anguilla","Antigua &amp; Barbuda","Argentina","Armenia","Aruba","Australia","Austria","Azerbaijan","Bahamas","Bahrain","Bangladesh","Barbados","Belarus","Belgium","Belize","Benin","Bermuda","Bhutan","Bolivia","Bosnia &amp; Herzegovina","Botswana","Brazil","British Virgin Islands","Brunei","Bulgaria","Burkina Faso","Burundi","Cambodia","Cameroon","Canada","Cape Verde","Cayman Islands","Central Arfrican Republic","Chad","Chile","China","Colombia","Congo","Cook Islands","Costa Rica","Cote D Ivoire","Croatia","Cuba","Curacao","Cyprus","Czech Republic","Denmark","Djibouti","Dominica","Dominican Republic","Ecuador","Egypt","El Salvador","Equatorial Guinea","Eritrea","Estonia","Ethiopia","Falkland Islands","Faroe Islands","Fiji","Finland","France","French Polynesia","French West Indies","Gabon","Gambia","Georgia","Germany","Ghana","Gibraltar","Greece","Greenland","Grenada","Guam","Guatemala","Guernsey","Guinea","Guinea Bissau","Guyana","Haiti","Honduras","Hong Kong","Hungary","Iceland","India","Indonesia","Iran","Iraq","Ireland","Isle of Man","Israel","Italy","Jamaica","Japan","Jersey","Jordan","Kazakhstan","Kenya","Kiribati","Kosovo","Kuwait","Kyrgyzstan","Laos","Latvia","Lebanon","Lesotho","Liberia","Libya","Liechtenstein","Lithuania","Luxembourg","Macau","Macedonia","Madagascar","Malawi","Malaysia","Maldives","Mali","Malta","Marshall Islands","Mauritania","Mauritius","Mexico","Micronesia","Moldova","Monaco","Mongolia","Montenegro","Montserrat","Morocco","Mozambique","Myanmar","Namibia","Nauro","Nepal","Netherlands","Netherlands Antilles","New Caledonia","New Zealand","Nicaragua","Niger","Nigeria","North Korea","Norway","Oman","Pakistan","Palau","Palestine","Panama","Papua New Guinea","Paraguay","Peru","Philippines","Poland","Portugal","Puerto Rico","Qatar","Reunion","Romania","Russia","Rwanda","Saint Pierre &amp; Miquelon","Samoa","San Marino","Sao Tome and Principe","Saudi Arabia","Senegal","Serbia","Seychelles","Sierra Leone","Singapore","Slovakia","Slovenia","Solomon Islands","Somalia","South Africa","South Korea","South Sudan","Spain","Sri Lanka","St Kitts &amp; Nevis","St Lucia","St Vincent","Sudan","Suriname","Swaziland","Sweden","Switzerland","Syria","Taiwan","Tajikistan","Tanzania","Thailand","Timor L'Este","Togo","Tonga","Trinidad &amp; Tobago","Tunisia","Turkey","Turkmenistan","Turks &amp; Caicos","Tuvalu","Uganda","Ukraine","United Arab Emirates","United Kingdom","United States of America","Uruguay","Uzbekistan","Vanuatu","Vatican City","Venezuela","Vietnam","Virgin Islands (US)","Yemen","Zambia","Zimbabwe"];

3단계) ​​CSS 추가:

컨테이너에는 "상대적" 위치가 있어야 합니다.

예시

* { box-sizing: border-box; }
body {
  font: 16px Arial;
}
.autocomplete {
  /*the container must be positioned relative:*/
  position: relative;
  display: inline-block;
}
input {
  border: 1px solid transparent;
  background-color: #f1f1f1;
  padding: 10px;
  font-size: 16px;
}
input[type=text] {
  background-color: #f1f1f1;
  width: 100%;
}
input[type=submit] {
  background-color: DodgerBlue;
  color: #fff;
}
.autocomplete-items {
  position: absolute;
  border: 1px solid #d4d4d4;
  border-bottom: none;
  border-top: none;
  z-index: 99;
  /*position the autocomplete items to be the same width as the container:*/
  top: 100%;
  left: 0;
  right: 0;
}
.autocomplete-items div {
  padding: 10px;
  cursor: pointer;
  background-color: #fff;
  border-bottom: 1px solid #d4d4d4;
}
.autocomplete-items div:hover {
  /*when hovering an item:*/
  background-color: #e9e9e9;
}
.autocomplete-active {
  /*when navigating through the items using the arrow keys:*/
  background-color: DodgerBlue !important;
  color: #ffffff;
}


4단계) 자바스크립트 추가:

예시

function autocomplete(inp, arr) {
  /*the autocomplete function takes two arguments,
  the text field element and an array of possible autocompleted values:*/
  var currentFocus;
  /*execute a function when someone writes in the text field:*/
  inp.addEventListener("input", function(e) {
      var a, b, i, val = this.value;
      /*close any already open lists of autocompleted values*/
      closeAllLists();
      if (!val) { return false;}
      currentFocus = -1;
      /*create a DIV element that will contain the items (values):*/
      a = document.createElement("DIV");
      a.setAttribute("id", this.id + "autocomplete-list");
      a.setAttribute("class", "autocomplete-items");
      /*append the DIV element as a child of the autocomplete container:*/
      this.parentNode.appendChild(a);
      /*for each item in the array...*/
      for (i = 0; i < arr.length; i++) {
        /*check if the item starts with the same letters as the text field value:*/
        if (arr[i].substr(0, val.length).toUpperCase() == val.toUpperCase()) {
          /*create a DIV element for each matching element:*/
          b = document.createElement("DIV");
          /*make the matching letters bold:*/
          b.innerHTML = "<strong>" + arr[i].substr(0, val.length) + "</strong>";
          b.innerHTML += arr[i].substr(val.length);
          /*insert a input field that will hold the current array item's value:*/
          b.innerHTML += "<input type='hidden' value='" + arr[i] + "'>";
          /*execute a function when someone clicks on the item value (DIV element):*/
              b.addEventListener("click", function(e) {
              /*insert the value for the autocomplete text field:*/
              inp.value = this.getElementsByTagName("input")[0].value;
              /*close the list of autocompleted values,
              (or any other open lists of autocompleted values:*/
              closeAllLists();
          });
          a.appendChild(b);
        }
      }
  });
  /*execute a function presses a key on the keyboard:*/
  inp.addEventListener("keydown", function(e) {
      var x = document.getElementById(this.id + "autocomplete-list");
      if (x) x = x.getElementsByTagName("div");
      if (e.keyCode == 40) {
        /*If the arrow DOWN key is pressed,
        increase the currentFocus variable:*/
        currentFocus++;
        /*and and make the current item more visible:*/
        addActive(x);
      } else if (e.keyCode == 38) { //up
        /*If the arrow UP key is pressed,
        decrease the currentFocus variable:*/
        currentFocus--;
        /*and and make the current item more visible:*/
        addActive(x);
      } else if (e.keyCode == 13) {
        /*If the ENTER key is pressed, prevent the form from being submitted,*/
        e.preventDefault();
        if (currentFocus > -1) {
          /*and simulate a click on the "active" item:*/
          if (x) x[currentFocus].click();
        }
      }
  });
  function addActive(x) {
    /*a function to classify an item as "active":*/
    if (!x) return false;
    /*start by removing the "active" class on all items:*/
    removeActive(x);
    if (currentFocus >= x.length) currentFocus = 0;
    if (currentFocus < 0) currentFocus = (x.length - 1);
    /*add class "autocomplete-active":*/
    x[currentFocus].classList.add("autocomplete-active");
  }
  function removeActive(x) {
    /*a function to remove the "active" class from all autocomplete items:*/
    for (var i = 0; i < x.length; i++) {
      x[i].classList.remove("autocomplete-active");
    }
  }
  function closeAllLists(elmnt) {
    /*close all autocomplete lists in the document,
    except the one passed as an argument:*/
    var x = document.getElementsByClassName("autocomplete-items");
    for (var i = 0; i < x.length; i++) {
      if (elmnt != x[i] && elmnt != inp) {
      x[i].parentNode.removeChild(x[i]);
    }
  }
}
/*execute a function when someone clicks in the document:*/
document.addEventListener("click", function (e) {
    closeAllLists(e.target);
});
}

5단계) "myInput"에 대한 자동 완성 효과 시작:

예시

자동 완성 기능의 두 번째 매개변수로 국가 배열을 전달합니다.

<script>
autocomplete(document.getElementById("myInput"), countries);
</script>