1.
2.
<!DOCTYPE HTML><HTML><Head> <MetaCharSet= "UTF-8"> <Scripttype= "Text/javascript" > <!-- functionStrokedasharray (_value) {Console.log ("Dash array:"+_value); varSvgforstrokeline=document.getElementById ("Svgforstrokeline"); Svgforstrokeline.setattribute ("Stroke-dasharray", _value); } functionStrokedashoffset (_value) {Console.log ("Dash offset:"+_value); varSvgforstrokeline=document.getElementById ("Svgforstrokeline"); Svgforstrokeline.setattribute ("Stroke-dashoffset", _value); varvalue01=Svgforstrokeline.getattribute ("Stroke-dashoffset"); Console.log ("Dash Offset-value:"+value01); } - </Script></Head><Body> <svgID= "Svgforstroke"width= "The "Height= "$"xmlns= "Http://www.w3.org/2000/svg"> <g> < LineID= "Svgforstrokeline"Fill= "None"Stroke= "#000000"Stroke-width= "5"Stroke-dasharray= "NULL"Stroke-linejoin= "NULL"Stroke-linecap= "Round"X1= "0"Y1= "All"X2= "The "y2= "All"/> </g> </svg> <P>Click the slider below (or enter a value) to experience the following:<BR> <!--<strong>stroke-dasharray:</strong> <input type= "range" min= "0" max= "+" value= "0" size= "Onchange=" Javascript:document.querySelector ("#svgForStroke line"). SetAttribute ("Stroke-dasharray", this.value) '/> <br> <strong>stroke-dashoffset:</strong> <input type= ' range ' min= "0" max= "value=" 0 "size=" "Onchange=" Javascript:document.querySelector ("#svgForStroke line"). SetAttribute ("Stroke-dashoffset", This.value) '/> - <Strong>Stroke-dasharray:</Strong> <inputtype= "Range"min= "0"Max= "The "value= "0"size= "+"onchange= ' Strokedasharray (this.value) '/> <BR> <Strong>Stroke-dashoffset:</Strong> <inputtype= "Range"min= "0"Max= "The "value= "0"size= "+"onchange= ' Strokedashoffset (this.value) '/> </P></Body></HTML>
3.
4.
5.
JS. event function