-
Notifications
You must be signed in to change notification settings - Fork 0
/
admin.js
36 lines (25 loc) · 1.16 KB
/
admin.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
document.querySelector("#button").addEventListener("click" , place);
var placedata= JSON.parse(localStorage.getItem("placedata")) || []
function place(){
var placename = document.querySelector("#place").value
var placecity = document.querySelector("#city").value
var placeimage = document.querySelector("#image").value
var fooddetail = document.querySelector("#food").value
var placedetail = document.querySelector("#placede").value
var placeprice = document.querySelector("#price").value
var pricedetail =document.querySelector("#pricedetail").value
var placeleft = document.querySelector("#left").value
var data={
placename: placename,
placecity: placecity,
placeimage:placeimage,
placedetail:placedetail,
fooddetail: fooddetail,
placeprice : placeprice,
pricedetail:pricedetail,
placeleft:placeleft,
};
placedata.push(data)
console.log(placedata)
localStorage.setItem("placedata" ,JSON.stringify(placedata))
}