[Bootstrap] Search(검색창)

2022. 11. 23. 03:10·Framework | Library/Bootstrap
728x90

기본 검색창 1

<div class="input-group">
  <div class="form-outline">
    <input type="search" id="form1" class="form-control" />
    <label class="form-label" for="form1">Search</label>
  </div>
  <button type="button" class="btn btn-primary">
    <i class="fas fa-search"></i>
  </button>
</div>

 

기본 검색창 2

<div class="input-group">
    <input type="search" class="form-control rounded" placeholder="Search" aria-label="Search" aria-describedby="search-addon" />
    <button type="button" class="btn btn-outline-primary">search</button>
</div>

 

검색 후 알림창

<div class="input-group">
  <div class="form-outline">
    <input id="search-input" type="search" id="form1" class="form-control" />
    <label class="form-label" for="form1">Search</label>
  </div>
  <button id="search-button" type="button" class="btn btn-primary">
    <i class="fas fa-search"></i>
  </button>
</div>
<script>
const searchButton = document.getElementById('search-button');
const searchInput = document.getElementById('search-input');
searchButton.addEventListener('click', () => {
  const inputValue = searchInput.value;
  alert(inputValue);
});
</script>

'Framework | Library > Bootstrap' 카테고리의 다른 글

[Bootstrap] range  (0) 2022.11.23
[Bootstrap] Radio  (0) 2022.11.23
[Bootstrap] Toggle Switch  (0) 2022.11.23
[Bootstrap] Horizontal alignment(text-center, d-flex, justify-content)  (0) 2022.11.23
[Bootstrap] (m, p, t, b, l, r, x, y),(0, 1, 2, 3, 4, 5, auto),(n1, n2, n3, n4, n5), (xs, sm, md, lg, xl, xxl)  (0) 2022.11.21
'Framework | Library/Bootstrap' 카테고리의 다른 글
  • [Bootstrap] Radio
  • [Bootstrap] Toggle Switch
  • [Bootstrap] Horizontal alignment(text-center, d-flex, justify-content)
  • [Bootstrap] (m, p, t, b, l, r, x, y),(0, 1, 2, 3, 4, 5, auto),(n1, n2, n3, n4, n5), (xs, sm, md, lg, xl, xxl)
arajo
arajo
  • arajo
    아라 메모장
    arajo
  • 전체
    오늘
    어제
    • 분류 전체보기 (509)
      • Language (298)
        • HTML (55)
        • CSS (11)
        • JavaScript (70)
        • TypeScript (8)
        • Python (33)
        • Java (119)
        • C (0)
        • C# (2)
      • Programming (92)
        • Programming (14)
        • Web (51)
        • Apache (1)
        • MySQL (23)
        • AWS (3)
      • Framework | Library (26)
        • Framework | Library (3)
        • Vue.js (2)
        • React.js (5)
        • React Native (4)
        • Node.js (1)
        • Ajax (1)
        • Bootstrap (8)
        • Spring (1)
        • Flutter (1)
      • etc (2)
      • 휴식 (19)
        • 책 (13)
        • 일기 (5)
        • 게임 일기 (1)
      • A (71)
        • 공부 (18)
        • 기타 (6)
        • 일 (47)
  • 블로그 메뉴

    • 홈
    • 태그
    • 방명록
  • 링크

  • 공지사항

  • 인기 글

  • 태그

    HTML
    타입스크립트
    자바스크립트
    객체
    제어문
    Python
    리액트
    변수
    array
    object
    event
    next.js
    web
    Java
    react
    CSS
    파이썬
    TypeScript
    JavaScript
    MySQL
  • 최근 댓글

  • 최근 글

  • hELLO· Designed By정상우.v4.10.1
arajo
[Bootstrap] Search(검색창)
상단으로

티스토리툴바