Non implementation of JavaScript code

I am not able to get any data from my API

request using Ajax.

Any suggestions could be helpful.

Hi @hrishikeshkamath999,

Please share your HTML code instead of sharing the screenshot so that we can help you out with your query. this.status should be 200.

this.status == 200
<html>
<head>
	<title>ajax
	</title>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width ,intial-scale=1.0">
</head>
<body>
	<p id="display">default txt</p>
	<input id="value">
	<button id="btn" onclick="update_user()">SUBMIT</button>
	<script type="text/javascript">
		function update_user() {
			user_number=document.getElementById('value').value;
			htttrequest=new XMLHttpRequest();
			htttrequest.open('GET',"https://reqres.in/api/users/"+user_number);
			htttrequest.send();
			htttrequest.onreadystatechange=function(){
				if(this.readystate ==4 && this.status == 200){
					user_data=JSON.parse(this.responseText);
					document.getElementById("display").innerHTML=user_data.data.first_name;

				}
			}
		}
	</script>
</body>
</html>