setItem()
Обновлено: 23.03.2023
Визначення та використання
Метод setItem() встановлює значення зазначеного елемента Storage Object.
Метод setItem() належить до Storage Object, який може бути об’єктом localStorage або sessionStorrage.
Синтаксис
localStorage.setItem(keyname, value)
або:
sessionStorage.setItem(keyname, value)
Значення параметрів
| Parameter | Description |
|---|---|
| keyname | Required. A String specifying the name of the key you want to set the value of |
| value | Required. A String specifying the value of the key you want to set the value of |