I'm trying to have a slider move to a set position but also activate a function in the place of console.log. but it returns nothing until the slider is moved
javascript:
$(document).ready(function(){
$( function() {
$("#CPU_GHz").slider({
range: "min",
value: 0,
min: 0,
max: 10,
step: 0.1,
slide: function( event, ui ) {
$( "#amount_GHz" ).val( "Faster Than: " + ui.value + " GHz" ) ;
},
change: function(event, ui ) {
CPU_GHz = ui.value;
console.log(CPU_GHz);
}
});
$( "#amount_GHz" ).val( "Faster Than: " + $( "#CPU_GHz").slider( "value" ) + " GHz");
});
$('#CPU_GHz').val('5').change()
});
HTML:
<p>
<input type="text" id="amount_GHz" readonly style="border:0; color:#2c85c5; font-weight:bold;">
</p>
<div id="CPU_GHz"></div>