JSFiddle - React, Tailwind, and code Playground
HTML
<form name="form1" method="post" action="https://api.searchningbo.com/user/login">
<p>
key<br>
<label for="key"></label>
<input type="text" name="key" id="key">
<br>
<br>
device_id<br>
<label for="device_id"></label>
<input type="text" name="device_id" id="device_id">
<br>
<br>
username<br>
<label for="username"></label>
<input type="text" name="username" id="username">
<br>
<br>
password<br>
<label for="password"></label>
<input type="password" name="password" id="password">
<br>
<br>
<br>
<input type="submit" name="POST" id="POST" value="Login">
<br>
<br>
</form>
<div id="button">Click Here to Fire Jquery Ajax</div>
JavaScript
$("#button").click(function() {
alert("Sending");
$.ajax({
type: "POST",
dataType: 'JSON',
data: "{'username':'1','password':'1','key':'1','device_Id':'1'}",
url: "https://api.searchningbo.com/user/login",
},
success: function(data) {
alert(data);
}
});