I did code a simple css process bar. I need to get range or textbox value to Div width <div style="width:50%;">, When the user change value of range or textbox like textbox takes range value in this code. Can I do it using javascript? *I'm not good with JS so no idea how do I start! Is it possible to do?
here's my simple code:
.graph {
width:200px; margin-left:25px; height:20px;
background: rgb(168,168,168);
background: -moz-linear-gradient(top, rgba(168,168,168,1) 0%, rgba(204,204,204,1) 23%);
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(168,168,168,1)), color-stop(23%,rgba(204,204,204,1)));
background: -webkit-linear-gradient(top, rgba(168,168,168,1) 0%,rgba(204,204,204,1) 23%);
background: -o-linear-gradient(top, rgba(168,168,168,1) 0%,rgba(204,204,204,1) 23%);
background: -ms-linear-gradient(top, rgba(168,168,168,1) 0%,rgba(204,204,204,1) 23%);
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#a8a8a8', endColorstr='#cccccc',GradientType=0 );
background: linear-gradient(top, rgba(168,168,168,1) 0%,rgba(204,204,204,1) 23%);
position: relative;
}
#bar {
background:#09C; height:20px;
}
<div id="progress" class="graph"><div id="bar" style="width:50%;"></div></div>
<br>
<form>
<input type="range" min="0" max="100" step="5" onchange="rangevalue.value=value" id="textvalue" />
<br>
<input type="text" maxlength="3" id="rangevalue" onchange="textvalue.value=value">
</form>