Jquery UI Slider change value of slider when changed in input field

oBo picture oBo · Oct 9, 2012 · Viewed 43k times · Source

Heres a js fiddle

im trying to get the slider to jump to the correct position when I change the value in the input field. Iam using the Jquery UI slider.

Answer

Constantinius picture Constantinius · Oct 9, 2012

You attach to the change event of your input like so:

$("#storlek_testet").change(function() {
    $("#storlekslider").slider("value", $(this).val());
});