JSFiddle - React, Tailwind, and code Playground
by mahdiar_mansouri
HTML
<!DOCTYPE html>
<html lang="en">
<head>
<title>Quotes</title>
</head>
<body>
<!--<label id="lb">Find Quotes (Type Author Name)</label><br />-->
<label for="getQuotes">Find Quotes (Type Author Name)</label><br>
<input type = "text" id="getQuotes" name="getQuotes" placeholder="Search" style="margin:10px" size="50"/><br />
<button onclick="getQuote()" id="FetchQuotes" style="margin:10px">Fetch Quotes</button>
<p class ="quote" id="quotes"></p>
<script>
function getQuote() {
var author = document.querySelector("#getQuotes").value;
fetch("https://krv1022-motivate.azurewebsites.net/quote?getQuotes=" + author)
.then( res => res.text() )
.then( data => {
document.querySelector(".quote").value = data;
}
);
}
</script>
</body>
</html>