HTML Flashcards

1
Q

how do local storage and session storage differ

A

Both implement the same API. However, session storage is cleared when the browser is closed, however local storage is only removed when the history is cleared, or when it’s removed imperatively via .removeItem() or .clear()

Another difference:
- Local storage is shared between browser tabs of the same app
- Session storage is only accessible in the tab that stored the data.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What are the types of the values submitted in a web form?

A

String values

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is the most common use of preventDefault()

A

To prevent a form from submitting, as this is the default action when enter is hit, with a form tag that wraps the focused input.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly