HomeОбразованиеRelated VideosMore From: Helping Words

How to make Background Color Change using HTML,CSS and JAVASCRIPT

76 ratings | 9568 views
This tutorial is helpful for making Background Color Change using HTML,CSS and JAVASCRIPT...
Html code for embedding videos on your blog
Text Comments (16)
DIAA Ahmed (16 days ago)
It worked thanks a lot !!
WEB TIPS & TRICKS (6 months ago)
https://youtu.be/cFIkGp7B0lM basic to advanced
Dunee Sulo (9 months ago)
not working!!
premadudani dudani (9 months ago)
Not working,,what do I do??
keshava shourie (10 months ago)
what is [0].style represent here
Atimoca (1 year ago)
Cool!
mr. gamer (1 year ago)
You stole this video!!!!!! But I gave a like!!.
Geeta Gitu (1 year ago)
Hello Sir, how to change background color of select tag and option tag instead of blue default colour?
micro max (1 year ago)
jaldi btao bhai yaar
micro max (1 year ago)
bhai nahi chal raha same coding ki hai yaar
micro max (1 year ago)
<html> <head> <title></title> <script type="text/javascript"> function ChangeColor(Color){ document.getElementByTagName('body')[0].style.backgroundColor= Color.value; } </script> </head> <body> <select size="" onchange='ChangeColor(this);'> <option value="select">select a Colour</option> <option value="red">red</option> <option value="yellow">yellow</option> <option value="blue">blue</option> <option value="green">green</option> </select> </body> </html>
Helping Words (1 year ago)
Try this code:- <html> <head> <title>table</title> <style type="text/css"> select{ margin-left: 40%; margin-top: 20%; width: 300px; height: auto; font-size: 30px; padding-left: 10px; } </style> <script type="text/Javascript"> function changeColor(color){ document.getElementsByTagName('Body')[0].style.backgroundColor = color.value; } </script> </head> <body> <!-- Choose color and Change body color through option --> <select id='c1' size='1' onChange='changeColor(this);'> <option value="select">Select a Color</option> <option value="Red">Red</option> <option value="Yellow">Yellow</option> <option value="Green">Green</option> <option value="Blue">Blue</option> </select> </body> </html>
- (1 year ago)
thank you :)
harman grewal (1 year ago)
not working for me
harman grewal (1 year ago)
thanks buddy
Helping Words (1 year ago)
use this code bro- <html> <head> <title>table</title> <style type="text/css"> select{ margin-left: 40%; margin-top: 20%; width: 300px; height: auto; font-size: 30px; padding-left: 10px; } </style> <script type="text/Javascript"> function changeColor(color){ document.getElementsByTagName('Body')[0].style.backgroundColor = color.value; } </script> </head> <body> <!-- Choose color and Change body color through option --> <select id='c1' size='1' onChange='changeColor(this);'> <option value="select">Select a Color</option> <option value="Red">Red</option> <option value="Yellow">Yellow</option> <option value="Green">Green</option> <option value="Blue">Blue</option> </select> </body> </html>

Would you like to comment?

Join YouTube for a free account, or sign in if you are already a member.