What if I wanted to change the background color as well as the font color by a click event on any place on the web page, to create a contrast, is there any way I can do that?
im trying to learn java. thank you for your sample. it's so easy to understand. how can i access the color code you were just copying. i think that is also good for beginner like me. thank you.:)
it goes in this way i=0; a=i++; b=++i; now the value of a is 0 but value of b is 1 ++i gets incremented there itself where as i++ gets incremented when i is mentioned after i++. if, it was in this way i=0; a=i++; a=i; b=++i; then a and b would be 1.
im trying to code two buttons one makes the color change and a different one to take me to a different page, i typed in the code for the color change button correctly and it works but when i code in the other button it doesnt work and instead does both things at once so it changes the color and takes me to the next page. how do i fix this? how do i make it so that both codes arent linked to the same button?
Switch color "click me" var color =["#e74c3c","#3498db","#2ecc71","#95a5a6","#f1c40f","#e74c3c"]; var i = 0; document.querySelector("button").addEventListener("click",function(){ i=i < color.lenght ? ++i :0; document.querySelector("body").style.background= color[i] })
The one between = and ? The condition and the first expression after ? Is executed if the result of the condition is True , if it's false the other one is executed
This was really helpful.Thank you! just bought your Udemy course too
i love your tutorials. there're easy, quicly and quiet. perfect. i'm so thankful!
Awesome 👌👌👌👌👌
pls make tutorial for auto changing background on click
css button 1:56
What about includes header and sidenav?
doesn't work for me
omg )) so easy )) thank you so much
What if I wanted to change the background color as well as the font color by a click event on any place on the web page, to create a contrast, is there any way I can do that?
Glad you didn't use note! Thank you.
you have made this presentation on what ?
Wish i could do this to animated gradients, actually trying to do that... but no luck.
Question:
color = color < color.length ? ++color : 0;
Why you placed ? before pre incrementation in this code?
Good Day, Sir. You have done a colorful job. Your video will really bring color to my knowledge. Thanks again, Sir.
script done 5:55
Whats the name of that page with those colors?
im trying to learn java. thank you for your sample. it's so easy to understand. how can i access the color code you were just copying. i think that is also good for beginner like me. thank you.:)
Java or Javascript? There very different... I'm probably going to get like r/whooshed...
@@strangejmaster I don't think it's a woosh lol, he's serious.
Please note, Java is different than JavaScript
very nice bro
button 0:44
Sir is this project can be link to java applet to javascript sir?
css body 1:35
dont really get why it doesn't work if you put i++ instead of ++i. can someone explain?
it goes in this way
i=0;
a=i++;
b=++i;
now the value of a is 0 but value of b is 1
++i gets incremented there itself where as i++ gets incremented when i is mentioned after i++.
if, it was in this way
i=0;
a=i++;
a=i;
b=++i;
then a and b would be 1.
Can i do that with images??? When i reload the page?
yes
add image
@@deepakkumar-fp8uj can you help with some tutorial link???
When the page has changed to the last colour in the array, then it takes two clicks to change the colour. How to fix this?
in the function add -1 after color.length, like this: "color.length-1 ? ++i : 0;"
how can I change the colour of the button by clicking?
can we change texts in similar way?
Good stuff
Cool video, just that id use an id from an html resource.
Thank you so much !
Hello sir.. can we use this method for switch between only two colours, like night and light mode!
Which text editor is this
What's the website for the colors?
Please change the background music to a less dismal and dreary one. Thanks,
Awesome
Where do you get the colors from?
im trying to code two buttons one makes the color change and a different one to take me to a different page, i typed in the code for the color change button correctly and it works but when i code in the other button it doesnt work and instead does both things at once so it changes the color and takes me to the next page. how do i fix this? how do i make it so that both codes arent linked to the same button?
did you ever find an answer
What is the website name for colors?
material palette
Thanks :3
Question,
Would you also store images in var if I wanted to change the background image on click?
Maybe it work
How to use images instead of colors .i want multiple images on every click.
same, I'm trying to make a click-based game, where when you click a button, the background image changes. Can you help me if you find a way to do it?
@@DemonxModRx i can help you, if you still want
@@yanickpalmers sure!
@@DemonxModRx add bubblebut1#0169 on discord
@@yanickpalmers public answer pls xd
sir i did but it was chang only one color
pls tell ,me how slove??
you have to check if you write the loop correct i++
Whats with the Song. Somewhat like a horror movie
h moment netong club
could we just do the function (and how) on the background itself instead of a button ?
Hi, do you still want to know the answer to your question)
Background sound too eritating
Instead of color can the same logic be used to change images
Yes!
h moment
Hey can you send me code because this code don"t working pls
Switch color "click me"
var color =["#e74c3c","#3498db","#2ecc71","#95a5a6","#f1c40f","#e74c3c"];
var i = 0;
document.querySelector("button").addEventListener("click",function(){
i=i < color.lenght ? ++i :0;
document.querySelector("body").style.background= color[i]
})
@@reonsbd for regular change after last index color:
add
if (i == color.length) i = 1;
i = i< color.length ? ++i :0; i need to know about this statment .. can anyone tell please ???
It's a kind if conditional statement like if
The one between = and ? The condition and the first expression after ? Is executed if the result of the condition is True , if it's false the other one is executed
It's called the ternary operator: th-cam.com/video/_lEgIImHoM4/w-d-xo.html
How Can I Put Something Like
onclick
But I Want It
while clicking
???
MustBeTheGanja
Thanks 😍
@MustBeTheGanja How???????
it is not working with for loop
Bruh, it only changes one color and then nothing works anymore :(
error
addEventList *e* ner
yes
@@OnlineTutorialsYT what yes lolol
can i use this to swap text?
could be used. But i don't know the code
can you make the same in angular too ..
AWESOMEEEEE!
i = i < color.length ? ++i : 0; could anyone explain what does mean in this code
?
It's Ternary operator.
In if-else statement, you would write the same code as...
if(i
it's so cool
Plz video make on scratch card
Disappointing music
DELETE THIS VIDEO AND DO VOICE OVER NO ONE SHOULD HAVE TO WATCH THIS WITH ANNOYING MUSIC