On Dec 20, 9:08*am, Stefan Mueller <seekw...@yahoo.com> wrote:
> I've several tables. The header row of each table looks like
> * <th class = "style_table1_header1">
> * * <div class = "style_column1"
> * * * onMouseover = "alert(this.className)">
> * * * Header of Column 1 in Table 1
> * * </div>
> * </th>
>
> * <th class = "style_table1_header2">
> * * <div class = "style_column2"
> * * * onMouseover = "alert(this.className)">
> * * * Header of Column 2 in Table 1
> * * </div>
> * </th>
>
> * ...
>
> If you move the mouse pointer over the first header in table 1 'alert
> (this.className)' in the onMouseover event displays 'style_column1'.
> I there also a way to display the classname of <th> (in this example
> 'style_table1_header1')?
The trivial answer is:
alert(this.parentNode.className);
But there may be more to your question than you've posted. You can
also put a listener on the th of course, but I suspect you don't want
to do that.
--
Rob
|