JS Type error | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

JS Type error

What’s wrong here? It says the function isn’t real or something. https://code.sololearn.com/W0e6s1IPS8ED/?ref=app

21st Feb 2019, 11:50 PM
Yosharu
Yosharu - avatar
2 Answers
+ 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.
21st Feb 2019, 11:59 PM
Arushi Singhania
Arushi Singhania - avatar
+ 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(); }
22nd Feb 2019, 1:11 AM
Boris Batinkov
Boris Batinkov - avatar