I have a function that is a JavaScript slider. When its moved, it outputs the value to an input textarea. I would like to write it to a div; however, I can’t seem to get it working using innerhtml.
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
var slider=new Array();
slider[1]=new Object();
slider[1].min=0;
slider[1].max=200;
slider[1].val=0;
slider[1].onchange=setBoxValue;
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
function setBoxValue(val, box) {
var b=document.getElementById('output'+box);
val=Math.round(val*1000)/1000;
b.value=val;
// THIS IS WHAT I CANT SEEM TO GET WORKING, DOES THE SYNTAX LOOK OKAY?
document.getElementById('test').innerHTML='value';
}
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
As you’ve tagged jQuery, you can just use: