make jquery value available in php

make jquery value available in php

hello,

im quite new to jquery so i guess my questions are  beginners questions.

I have a piece of jquery for getting the value of a  slide button with html range.

I want the output in php available.

But for me it is not clear how jquery sets the output of the range slider in a variable?

And I also dont know how to post (like html $_POST) this variable to the php server?


what steps should I follow to get the value  in a 'default' piece of code ?


code: 
  1. <html>
      $(function(){
          $("#range").change(function()
       { 
       $("#value").text($(this).val());     
          }
       );   
      });
     
    </script>
    </head>
    <input type="range" min="1" value="3" max="4" name="value" id="range"/>
    <span id="value"></span>
    <br><br>
    <?php
    $offset = ob_get_clean();
    print_r($offset);
    ?>
    </html>