this code is suppose to accept user value and then give a corresponding alert box but it's not working. May I know what is wrong with this code? I did a lot of google search (many point to this website) but I can't seems to find the solution? Please help and thanks in advance.
index.html
<html>
<head>
<title>the title</title>
   <script type="text/javascript" src="http://code.jquery.com/jquery-1.9.0.min.js"></script>
<script type="text/javascript">
 function check() {
      var    one = $('#first').val();
       var   two = $('#second').val();
       var  three = $('#third').val();
       var  four = $('#fourth').val();  
    $.post("result.php", { 
    first: one,
    second: two,
    third: three,
    fourth: four
},function(data)
        {
         if (data=="yay") //for no input
         { alert("yay");
         }
         else 
         {
         alert("nay");
         }
         }
        } 
</script>
</head>
<body>
        <form name="form">
    <input type="text" id="first">
    <input type="text" id="second">
     <input type="text" id="third">
    <input type="text" id="fourth">
    <input type="button" value="get" onclick="check();">
    </form>
</body>
</html>
result.php
<?php
    $one = $_POST["first"];
        $two = $_POST["second"];
         $three =$_POST["third"];
         $four = $_POST["fourth"];
         if($one > 5)        
         {
         echo "yay";
         }
     elseif($two > 10 )        {
         echo "yay";  }
             elseif($three > 15 )        
             {
         echo "yay";  
             }
             elseif($four > 20 )        
             {
         echo "yay";  
             }
           else{
               echo "nay";
           }
?>
dataTypejson and echo ajson_encodearray with the result