I wanted build a web 8ball app, I wanted to use PHP for it. I included jQuery and I set everything up, but my .getJSON function wasnt working
var button = document.getElementById("submitsend")
button.onclick = async function() {
var input = document.getElementById("userinput")
input.value = ""
var output = document.getElementById("output")
$.getJSON("https://api.eriner.repl.co/fun/8ball", function(data) {
console.log(data)
})
}
<link rel="stylesheet" href="https://easycss.bookie0.repl.co/dark.css">
<nav>
<h1>Hello</h1>
</nav>
<div class="content">
<p id="output">Ask me anything.</p>
<form onsubmit="return false" id="formm">
<input id="userinput" placeholder="Say something." type="text">
<button type="button" id="submitsend">Send</button>
</form>
</div>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>