+ 1
First you need to wrap your code in the window.onload function as told before, to remove the error... Then, in your js code you never stored the playercircle as a variable, so it won't do any operation on an non existing variable. Try to add let playercircle=document.querySelector(".playercircle"); Then you'll be able to use it in the computed style method...
1st Nov 2020, 5:17 PM
EmmanueLZ.
EmmanueLZ. - avatar
+ 1
Algfish31 You need to use "EventListeners" for that. You're not even half the js course, maybe you didn't see it yet. You can check that site to get complementary support. https://www.tutorialrepublic.com/javascript-tutorial/javascript-event-listeners.php Also you'll need to wrap your external js script in a wrapper function to make it read on the playground.It will remove the message error you have actually. window.onload=()=>{ //Insert your code } https://www.sololearn.com/Discuss/1502977/?ref=app
1st Nov 2020, 4:22 PM
EmmanueLZ.
EmmanueLZ. - avatar
+ 1
Use onclick attribute in button tags so that you set or call a function when given button is clicked button onclick="function();">
1st Nov 2020, 4:24 PM
HBhZ_C
HBhZ_C - avatar
0
Algfish31 , Glad it seems to work for you🙂(But when I launch your code in Sololearn playground, I have the error caused by the missing window.onload function and the code is not processing further).
2nd Nov 2020, 4:15 PM
EmmanueLZ.
EmmanueLZ. - avatar