Javascript code doubt

I have attached my code below , I dont see why its not showing the expected output from the reqres page. Please help me out!

Default text

<button onclick="values()">Submit</button>
<script type="text/javascript">
		function values()
			num = document.getElementById('usernum').value;

				httpRequest= new XMLHttpRequest();"GET",""+num);

				httpRequest.onreadystatechange = function (){

					if(this.readyState==4 && this.status==200){ 

						userdata = JSON.parse(this.responseText);
						document.getelementById("output").innerHTML =;



Hi @hrishekesh2010386,

In the last line of code, it should be getElementById. JS is a case-sensitive language.

document.getElementById(“output”).innerHTML =;

Do let me know if you are still stuck.

Yep , it worked , thank you very much !!!