0
radius is not defined , I don't know which css attribute can refer to border radius using JavaScript .
The desired outcome is width should be 150px for img and its border radius should 50%. https://code.sololearn.com/WP304BfGAVma/#
39 Answers
+ 7
document.querySelector("img").style.borderRadius = "50%";
+ 5
Mustafa Azzoz Compliers are universal. However, in many online courses, the course software is programmed behind the scenes to take specific inputs in order to test if the case is true or not.
+ 4
Mustafa Azzoz Many members do attempt to get quick answers here for homework. But we often remind them that this isn't simply a place for answers to your homework. This is a learning platform. We ask that they provide their attempt and then we may offer assistance. Like you have so I offered to help.
+ 4
Mustafa Azzoz if it is possible to help, some of us will go the extra mile to help. However, it is often very difficult to help with things that are not related to this app. So we suggest post topics remain on topic, i.e. in relation to sololearn.
+ 4
Thank you, but I can't take your personal account. That is a privacy concern. You shouldn't trust just anyone with your account information. Especially were currency is involved. What is the name of the course I may have already completed it.
+ 4
Mustafa Azzoz Reset the code and in the app.js put this
let txt = document.getElementById("container");
txt.style.textAlign = "center";
document.querySelector("img").style.borderRadius = "50%";
document.querySelector("img").style.width = "150px";
+ 3
Mustafa Azzoz Now I see your question is in regard to a Udemy course. Why didn't you say so before? No wonder why you keep dodging my question to rather or not it works correctly in the sololearn app. I'm here debugging for this app. Udemy wants wants a very specific answer. This is sololearn. Perhaps someone has provided the answer for you in the Udemy community for lesson you're on.
+ 3
Mustafa Azzoz in the Q/A for the lesson there were also other examples that passed
document.querySelector('#container').style.textAlign='center';
document.querySelector('img').style.width='150px';
document.querySelector('img').style.borderRadius='50%';
+ 2
this is how i do it:
https://code.sololearn.com/WS8FQFwJawBK/?ref=app
+ 2
Chris Coder It's because of the order in wich the elements are loaded. If you load the JS objects, functions, etc. before the HTML elements, you'd be telling your code to work with elements that don't exist (yet). So, with window.onload = function ()... You're telling your code to 1) Wait for the HTML page and its elements to be loaded first and just then: 2) Execute the scripts with the now-existing elements.
+ 2
Mustafa Azzoz If it didn't work in the app you should have said so. I asked yesterday if it worked in the app.
You and Your Mom had me thinking there was only an issue on my end. I said it required an onload function.
https://code.sololearn.com/WKbNaqC0KOiu/?ref=app
+ 2
About the udemy course. Is it free? If so I wouldn't mine giving my go at it. To see if I could help with the issue 😀
+ 2
Mustafa Azzoz Awesome! I'm relieved that something was resolved after all of this.
+ 2
Whats the Exercise number?
+ 1
umm but why urs doesnt work is because for ur document with ur raidus u have .style.border-raidus. u have no equal sign and no percent thing.
how it should look:
.style.borderRadius = 50 + “%”;
+ 1
Your Mom you are right but this playground is throwing an error. Oops.
+ 1
Your Mom is your code working correctly for you in the app? Because it is not for me. But on desktop it is.
+ 1
I'm using the app on android.
+ 1
It worked on Decoder , The outcome basically must be a circle , Right ?
+ 1
Your Mom I figured it out. For some reason I have to add an onload function to your code and then it works.