JavaScript
- 3 ответа
- 0 вопросов
2
Вклад в тег
let element = document.querySelector('.radio');
element.addEventListener('click', function(event) {
let cat = fetch("http://my-site/transaction", {
method: 'POST',
headers{
'Content-type': 'application/x-www-form-urlencoded'
}
body: `radio=${event.target.value}`,
})
.then(response => {response.json())
.then(data => data);
});