User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the HTML and CSS section within the Web Development category of DaniWeb, a massive community of 402,507 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,837 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our HTML and CSS advertiser: Lunarpages Web Hosting
Feb 5th, 2005
Views: 24,229
Use onMouseover to change the background color of your webpage. Can be applied to change other things like images and so on.
html Syntax | 3 stars
  1. <!-- Experiments with the mouse vegaseat 6/15/02 -->
  2. <!-- onMouseover, href, bgcolor -->
  3.  
  4. <html>
  5. <head>
  6.  
  7. <title>change the background color with onMouseover</title>
  8.  
  9. </head>
  10. <body>
  11.  
  12. Move the cursor to the color you want ...
  13. <br>
  14. <br>
  15. <a href="" onMouseover="document.bgColor='red'">Red</a>
  16. <br>
  17. <a href="" onMouseover="document.bgColor='orange'">Orange</a>
  18. <br>
  19. <a href="" onMouseover="document.bgColor='yellow'">Yellow</a>
  20. <br>
  21. <a href="" onMouseover="document.bgColor='green'">Green</a>
  22. <br>
  23. <a href="" onMouseover="document.bgColor='magenta'">Magenta</a>
  24. <br>
  25. <a href="" onMouseover="document.bgColor='purple'">Purple</a>
  26. <br>
  27.  
  28. </body>
  29. </html>
Comments (Newest First)
lizzeelike | Newbie Poster | 22 Days Ago
is it possible to do this same work using outside"CSS" file?plz do reply
thanks
lizzeelike
remotions | Newbie Poster | Jun 9th, 2007
It works, just you need to fill the href="" with # so that it looks like this: href="#". Or you will have mouse click to point your browser to the start page of your site. Also you have to disable CSS background styles for particular page.
anilexi | Newbie Poster | Mar 30th, 2007
Boring 100% Nothing Work It. Like U
prathapvs | Newbie Poster | Oct 15th, 2006
i think its not working
parthireach | Unverified User | Sep 14th, 2006
:rolleyes: hai
Post Comment

Only community members can submit or comment on code snippets. You must register or log in to contribute.

DaniWeb Marketplace (Sponsored Links)
All times are GMT -4. The time now is 5:55 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC