<form action="" name="cars">
<input type="text" name="model">
<input type="text" name="type">
<input type="number" name="volume" min="0">
<button id="clickSecond">Відправка Авто</button>
</form>
let clickSecond = document.getElementById('clickSecond')
let arr = []
let content = (arr) => {
class Users {
constructor(model, type, volume) {
this.model = model;
this.type = type;
this.volume = volume
}
}
arr.push(new Users(`${document.cars.model.value}`, `${document.cars.type.value}`, `${document.cars.volume.value}`))
let string = JSON.stringify(arr)
localStorage.setItem('user', string)
}
clickSecond.onclick = (e) => {
e.preventDefault()
content(arr)
}