Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to display the 'ID' of a object.

Status
Not open for further replies.

Pierro001

Programmer
Feb 8, 2007
6
NL
I have this code:

<html>
<table border="1" width="100%">
<tr>
<td id = "a">1</td>
<td id = "b">2</td>
</tr>
<tr>
<td id = "c">3</td>
<td id = "c">4</td>
</tr>
</table>
</html>

So now i want to display the id (not the value) of the cell if the mouse moves over that cell in a messagebox.
Is this possible?

greetz Pieter
 
This is how that would be done:

Code:
<html>
<table border="1" width="100%">
        <tr>
    <td id = "a" [!]onmouseover="alert(this.id)"[/!]>1</td>
    <td id = "b">2</td>
        </tr>
        <tr>
    <td id = "c">3</td>
    <td id = "c">4</td>
         </tr>
</table>
</html>

do that for each <td>.

<.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top