Hello dcode. When I use computer style to get img width for an image whose src is an online link it works right. But for the same exact image, when I download it and then I use the get computed style method on that same image who’s src now is local to my pc, I get 0px. Any ideas why that is happening?
Is there way to convert a color we derive using window.window.getComputedStyle(color) of an HTML element like red, yellow, green.. ? Thanks in advance for all your effort, Love from India ❤️ Example: var h1_ele = document.getElementById('heading'); var h1_ele_css_details = window.getComputedStyle(h1_ele); console.log(h1_ele_css_details.color); output: rgb(30, 144, 255) Help needed: I want direct color name to be displayed on the console. Is there a way to achieve it?
Thank you for the video, great job! I have a question. If you get the value of the width for example and you want to add on this something (for example from 40px to make it 50px) how do you do it ? [But not to change it from 40 to 50, to add 10 more px instead)
You can do something like this: var myVariable = window.getComputedStyle(document.getElementById('ElementIDHere')).width += 10; That would probably work... I think. Haven't tried it.
Love From India ❣
wow , ~nice large readable font, NICE WORK~
Hello dcode.
When I use computer style to get img width for an image whose src is an online link it works right. But for the same exact image, when I download it and then I use the get computed style method on that same image who’s src now is local to my pc, I get 0px.
Any ideas why that is happening?
Can I ask what is the name oƒ this green rounded font?
Thanks a lot. I learn more English and JavaScript. Your dyadic is very interesting!
Great explanation. Thank u!
Nice video! Thanks!
Thank you, This is one of the best videos I have come across.. Do you provide online training on JavaScript ?
Is there way to convert a color we derive using window.window.getComputedStyle(color) of an HTML element like red, yellow, green.. ?
Thanks in advance for all your effort, Love from India ❤️
Example:
var h1_ele = document.getElementById('heading');
var h1_ele_css_details = window.getComputedStyle(h1_ele);
console.log(h1_ele_css_details.color);
output: rgb(30, 144, 255)
Help needed: I want direct color name to be displayed on the console. Is there a way to achieve it?
Is this only applicable for inline styles?
Thank you for the video, great job! I have a question. If you get the value of the width for example and you want to add on this something (for example from 40px to make it 50px) how do you do it ? [But not to change it from 40 to 50, to add 10 more px instead)
You can do something like this:
var myVariable = window.getComputedStyle(document.getElementById('ElementIDHere')).width += 10;
That would probably work... I think. Haven't tried it.
great video
Thanks mate!
Very interesting! By the way, what VSCode color scheme are you using?
Hey, I'm using Min Dark.
@@dcode-software Thanks!
🔥❤️
thanks budy
Thankyou ))
good one
I have a question what is the diffrent between computedStyle and classList?
❤❤