<Script> varrangelist=Document.queryselectorall ('[type= "range"]'); for(varI=0; I<rangelist.length; I++){ //get the value I traversed in the current period and assign a value to range varRange=Rangelist[i]; Range.onchange=function(){ //range.onchange= event triggered when the value of input has changed //The onchange () event is typically used in user forms, such as events that are triggered when the contents of a text box change, or events that are triggered when the contents of a drop-down list box change. This. nextelementsibling.innerhtml= This. Value; //Modify the background color of #boxchangeboxbg ();//Event listener Name }; }; functionChangeboxbg () {//event Method properties being monitored varR=Red.value; varG=Green.value; varB=Blue.value; Box.style.backgroundColor=' RGB (${r},${g},${b}) '; }</Script>
The Input slider feature range JavaScript method uses