I made a possible solution using only Javascript to help you:
To get the visual appearance of a sad or happy face, I adjusted the minimum and maximum values of your input, as shown below:
<input id="slider1" type="range" min="0" max="20" />
I get the svg path for the mouth using:
var mouth = document.getElementById("mouth");
, EventListener :
slider.addEventListener("change", function() {
console.log(this.value);
mouth.setAttribute("d", "M45,110 C80," + 10 * this.value + " 140,110 150,110");
});
this.value.
, mouth.setAttribute("d", "values..."), svg .
- :
(function() {
var slider = document.getElementById("slider1");
var mouth = document.getElementById("mouth");
slider.addEventListener("change", function() {
console.log(this.value);
mouth.setAttribute("d", "M45,110 C80," + 10 * this.value + " 140,110 150,110");
});
})();
<h1>trying to move the line</h1>
<div>Circle size:
<input id="slider1" type="range" min="0" max="20" />
</div>
<svg width="600" height="600">
<circle id="face" cx="90" cy="90" r="70" stroke="black" stroke-width="1" fill="yellow" />
<path id="mouth" d="M45,110 C80,110 140,110 150,110" style="fill:none;stroke:deeppink;stroke-width:3" />
</svg>
, , svg .