+ 7
I think the error is because you are using width as function name. Try using something else like width1 or width2. It's working perfectly.
+ 4
The problem is:
element.width.value = value;
Instead you need:
element.style.width = value;
function widthChange()
{
var widthValue = slide.value;
slideValue.innerHTML = widthValue;
document.getElementById("rectShape").style.width = slide.value;
}
onload = ()=> {
widthChange();
}



