473,395 Members | 1,629 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

simple onmouseover className change fails

Tarantulus
114 100+
Hi guys,

I have the following simple function which errors in IE6

Expand|Select|Wrap|Line Numbers
  1. function changecss(id,class){
  2. document.getElementById(id).className = class;
  3. }
  4.  
and in the HTML I have

Expand|Select|Wrap|Line Numbers
  1. onmouseover="changecss(this.id,'hover');"
I can't see why it's not working, perhaps I can't see the wood for the trees...

can you assist?

Thanks in advance
Oct 21 '08 #1
1 1790
pronerd
392 Expert 256MB
What is the rest of the HTML for the tag calling that function? Is the ID attribute being set?

To make this simpler I would just pass the elment it self instead of the elements ID attribute.


Expand|Select|Wrap|Line Numbers
  1. function changecss(el,class){
  2.     el.className = class;
  3. }
  4.  


Expand|Select|Wrap|Line Numbers
  1. onmouseover="changecss(this,'hover');"
Oct 21 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: louissan | last post by:
Hi all, I have a slight display speed problem under IE5/6 when putting an onmouseover/out effect in a <div> tag inserted inside a relatively positioned parent block. Mozilla and Safari handle...
12
by: Epetruk | last post by:
Hi all, I want a page where the contents of a table cell are replaced with an image when the mouse moves over the cell, and the text is restored when the mouse moves out. Here's the html for the...
3
by: Rob Roberts | last post by:
I'm using .NET 2.0 and C# on a web site, and I'm trying to use the onmouseover and onmouseout events to do a rollover effect on an asp.net button. I've tried manually adding the events to the...
2
by: MrCode2k | last post by:
Hello, Trying to do: I just want a table that I can scroll and that has fixed headers. Problem: I got it to work but when I added the onmouseover event it didn't work anymore....
7
by: MrCode2k | last post by:
Hello, Trying to do: I just want a table that I can scroll and that has fixed headers. Problem: I got it to work but when I added the onmouseover event it didn't work anymore....
3
by: Vear | last post by:
Hi, I'm looking to change the cssclass on a hyperlink with the onmouseover. I've tried the 3 syntax's below but to no success. Can someone point me in the right direction. Thanks ...
1
by: KShapiro | last post by:
Hi All, I am trying to assist my wife, by making a simple menu system for the website. The web page is a .php4 file and does an include of the navigation file. Before it includes that file at...
3
by: oopaevah | last post by:
I have written some dom code to create a list of divs, each with it's own id. I want to set the onmouseover and onmouseout events to highlight the div when the mouse is over it. However I cannot...
10
oll3i
by: oll3i | last post by:
i wrote css class for a href but when i add this class to link it doesnt see the image but when i add the inline css it sees it i m writing javascript tab menu and i want tabs to change on mouse...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.