You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 lines
496 B

function send(){
data={
key:document.getElementById("key").value,
upvote: document.getElementById("upvote").checked,
downvote:document.getElementById("downvote").checked,
}
let response = await fetch('http://localhost:9000/submit', {
method: 'POST',
headers: {
'Content-Type': 'application/json;charset=utf-8'
},
body: JSON.stringify(data)
});
let result = await response.json();
document.getElementById("input").innerHTML= result.message
}