dsci2000 Posted January 22, 2006 Share Posted January 22, 2006 Hi all,I've a problem with a simple (or seem so) html page.I've the follow javascript function defined in the head section:<script type="text/javascript" language="javascript">function changeclass(vid,cls){ document.getEelementById(vid).class=cls;}</script>In the html body I write the code <td class="titolotableft" id="tdhowto" align="left" onMouseOver="changeclass('howto','tdhover')" onMouseOut="changeclass('howto','titolotableft')"> <a>Come si fa...</a> </td>but when in the browser (IE) this not work.What's wrong?thanks for help. Link to comment Share on other sites More sharing options...
Chocolate570 Posted January 22, 2006 Share Posted January 22, 2006 <html><head><script type="text/javascript" language="javascript">function changeclass(vid,cls){document.getEelementById(vid).className=cls;}</script></head><body><td class="titolotableft" id="tdhowto" align="left" onMouseOver="changeclass('howto','tdhover')" onMouseOut="changeclass('howto','titolotableft')"><a>Come si fa...</a></td></body></html> Link to comment Share on other sites More sharing options...
dsci2000 Posted January 24, 2006 Author Share Posted January 24, 2006 thanks for your reply but i tried to correct the code and the script dosen't work.any other ideas? tdhover and titolotableft are defined in a css file. Is that a problem? thanks for your help. Link to comment Share on other sites More sharing options...
Chocolate570 Posted January 26, 2006 Share Posted January 26, 2006 Well, you're trying to set an element with the id of 'howto', when it's called 'tdhowto'. Link to comment Share on other sites More sharing options...
dsci2000 Posted January 27, 2006 Author Share Posted January 27, 2006 oh oh... you're right. Thanks a lot. I'll try asap.bye Link to comment Share on other sites More sharing options...
aspnetguy Posted January 27, 2006 Share Posted January 27, 2006 plus you have this typo document.getEelementById(vid).className=cls; change getEelementById to getElementById 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