I would like to fetch data by clicking button.
current My work is like below code.
Are there any way to bind this?
Thanks
var apikey="https://opentdb.com/api.php?amount=1&type=multiple";
fetch(apikey)
.then(response => response.json())
.then(json => {
console.log(json);
});
<button type="button">get data</button>