A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://developer.mozilla.org/ko/docs/Web/API/Storage/removeItem below:

Storage.removeItem() - Web API | MDN

Storage.removeItem()

Baseline Widely available

Storage 인터페이스의 removeItem() 메소드에 키 이름을 파라미터로 전달하면 스토리지에서 해당 키를 삭제합니다.

문법
storage.removeItem(keyName);
파라미터
keyName

삭제하고자 하는 키 이름(DOMString).

반환값

반환값 없음.

예제

아래의 함수는 로컬 스토리지에 3 개의 데이터 아이템을 생성한 후 그 중 하나를 삭제합니다.

function populateStorage() {
  localStorage.setItem("bgcolor", "red");
  localStorage.setItem("font", "Helvetica");
  localStorage.setItem("image", "myCat.png");

  localStorage.removeItem("image");
}

참고 : 실 사용 예제는 Web Storage Demo를 참고하시기 바랍니다.

명세서 브라우저 호환성 같이 보기

Web Storage API 사용하기


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4