In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
JavaScript how to change the background color of the page, many novices are not very clear about this, in order to help you solve this problem, the following editor will explain for you in detail, people with this need can come to learn, I hope you can gain something.
The operating environment of this tutorial: windows7 system, javascript1.8.5 version, Dell G3 computer.
JavaScript changes the background color of a web page
Example 1: enter a color name to change the background color of a web page
Enter the name of the color in a text box (e.g. blue, purple) and click the button next to the text box to change the background color of the page to the color corresponding to the name in the text box.
Implementation code
Web discoloration function show () {var x=document.getElementsByTagName ("body"); var y=document.getElementById ("i1"); var c1=document.getElementById ("i2") .value; var c2 Switch (C1) {case 'blue': c2 = "blue"; break; case 'yellow': c2 = "yellow"; break; case 'light blue': c2 = "lightblue"; break; case 'purple': c2 = "purple"; break Case 'pink': c2 = "pink"; break;} y.style.backgroundColorcolors C2;}
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 242
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.