Q:

Unclear code in Javascript

I spent 4 hours trying to figure out what's going on in the following code.  I can hardly understand it, since I haven't programmed Javascript yet. 
Javascript:
function pincheck() {       
  var n = 123456789123,
  t = md5(n + " " + $("#wert").val()),
  e = $("input[name='some_hash']").val();
  $.post("https://url-test.com/site?check=" + t, {some_hash: e}, function(n) {
    $("#inputWert").html(n == t ? " <span style='color:green; font-weight:bold'>OK</span>" 
                                : "<span style='color:red; font-weight:bold'>NOT OK</span>")
  })
}

Corresponding HTML-form:
<form action="https://url-test.com/site" method="post" accept-charset="utf-8">
  <div style="display:none">
    <input type="hidden" name="some_hash" value="2cb6beab7ac4240043b20674a3dce6a5" />
  </div>    
  <input type="text" id="wert" name="wert" placeholder="WERT" onchange="pincheck()">
  <div id="inputWert">Please input</div>
  <input type="submit" value="Submit" />
  <h2>Please explain<br/><textarea name="explain" style="width: 650px;height: 100px;" placeholder="Explanation"></textarea><br/>    
</form>

My thoughts were: 

The function pincheck() checks if n==t 
But since t is a md5 hash, it
    can never be equal to n, which is a digit number. 
Is this correct?  If wert=000, will be the value of the variable "t" an MD5 of the string "123456789123 000"?  I hope I explained correct. 

The background of my question refers to our university IT-security task.  We have to guess some number, and then enter it into the text form, whos id should be "wert" I guess. 
I hope someone can help me.  Thank you in advance! 

A:

When the user types something into the WERT input field, the Javascript takes the user's input, puts 123456789123 at the beginning of it, calculates the MD5 hash of this, and assigns that to t. e is set to the contents of the hidden some_hash value. 
Then it performs an AJAX query, sending t and e to the url-test.com/site script.  t is sent in the check URL parameter, while e is sent in the some_hash POST data. 
The server script returns back a string.  If that string matches t, then it displays a green OK.  If they don't match, it displays a red NOT OK. 
My guess is this is part of a CAPTCHA test.  The hidden input is a code that indicates which image was displayed.  On the server, this code can then be used to look up the MD5 hash of the text in the image.