I have 1 div and 1 text input field, the div is visible and the input is hidden. The input one gets its value from a range slider, I want to use jQuery somehow to take the value from this input area and populate the div on the fly, I’ve tried the following with no luck, can anybody see where i may be going wrong?
$( ".value-slider" ).val( $( "#val-slider" ).slider( "value" ) );
$( ".price" ).html( $( ".value-slider" ).html() );
Assuming I’ve understood you correctly,
.value-slideris aninputelement, and.priceis adivelement. If that’s right, then you need to get the value of the input, rather than the HTML:However, since you’ve just set the value of
.value-slider, why not just store the value of the slider and use that?