watagal Posted May 25, 2006 Share Posted May 25, 2006 greetings,Trying to do: <div id="divToc" onmouseover="style.background-color='blue'" onmouseout ="style.background-color='red'" style="cursor:e-resize"></div> yet nothing changes. I've tried: "style.bgcolor=...", "this.style.back..." and nothing yet.Can I do this to a <div> tag or is my syntax wrong (again)?TIA,WG Link to comment Share on other sites More sharing options...
aspnetguy Posted May 25, 2006 Share Posted May 25, 2006 do this <div id="divToc"onmouseover="this.style.backgroundColor='blue'"onmouseout ="this.style.backgroundColor='red'" style="cursor:e-resize"></div> Link to comment Share on other sites More sharing options...
watagal Posted May 25, 2006 Author Share Posted May 25, 2006 Thanks aspnetguy. I know these are stupid questions, but I've seen "bgcolor", "backgroundColor", and "background-color" used for the same thing. I'm pulling my hair out.Is there rhyme or reason to all this? Better yet, is there a reference as to when to use what where?Thanks again - done venting.WG Link to comment Share on other sites More sharing options...
scott100 Posted May 25, 2006 Share Posted May 25, 2006 <head><script>[color="red"]document.bgColor="red";[/color]function change(){[color="green"]document.body.style.backgroundColor="green";[/color]}</script><style>[color="purple"]body{background-color:purple;}[/color]</style></head><body onload="change()"></body> document.bgColor="red"; This is the pure javascript waybackground-color:purple; This is the css waydocument.body.style.backgroundColor="green"; This is the dhtml way (note that to the letter c in color is uppercase) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now