Hello.

The plug-in ion.rangeSlider is installed, this is a plug-in slider diapason.

The task is as follows: Pass the number that the slider generates in the input field to the JS.

I just have to send them to the very contents of the div, here’s the code.

<script> $(document).ready(function () { var $range = $("#range_1"), $result = $("#result_1"); var track = function (data) { $result.html("" + data.from); }; $range.ionRangeSlider({ type: "single", min: 100, max: 11000000, from: 100, step: 100, onStart: track, onChange: track, onFinish: track, onUpdate: track, prettify_enabled: true, postfix: " " }); }); 

    2 answers 2

    Instead of $result = $("#some_input"); Substitute your input, and further

      var track = function (data) { $result.val(data.from); }; 
    • Thank you ... Only this chip does not work with my calculator. Calculator code <input id = "result" autofocus class = "form-control" style = "width: initial;" type = "text" name = "money" size = "10" maxlength = "10" value = "0.00" oninput = "var v = this.value; this.form.new.value = isNaN (v)? '' : (v * 1.33) .toFixed (2) "> <input class =" form-control "type =" text "disabled =" disabled "name =" new "size =" 10 "maxlength =" 10 "value =" 0.00 "> It is necessary to enter yourself in the input in order for the calculator to consider what tell me what to do? - Igor
    • one
      @ Igor, you better put the code here jsfiddle.net and add it to the question again. And then the comments are hard to understand what it is about. - Moonvvell
    • @ Igor, since we accepted the answer in this question, create a new one and describe what is not working for you now. And add the calculator code to the question itself. - Moonvvell
    • jsfiddle.net/gtrftqp3 here is a calculator. With the script that I should get the value in the input scrolling, everything works except for the calculator, the first input sends the value to JS, but for the calculator to work, you need to perform some action with this input (poke it, enter the symbol, etc.) - Igor

    Work with the values ​​of form elements is carried out using the method .val () . You use .html ()