•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the JavaScript / DHTML / AJAX section within the Web Development category of DaniWeb, a massive community of 426,478 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,232 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JavaScript / DHTML / AJAX advertiser: Lunarpages Web Hosting
Views: 1157 | Replies: 2
![]() |
•
•
Join Date: Jun 2007
Posts: 4
Reputation:
Rep Power: 0
Solved Threads: 0
Here in my project i am using this reference to know my current name of td. Below i provided sample code similar to my project. "this" won't working in Mozilla. I am migrating my project to Mozilla . So please help me.
<html>
<head>
<script>
function f(a)
{
alert(a);
}
</script>
</head>
<body>
<table border="1">
<tr>
<td name="dfdsfs11111111" onclick="f(this.name)">sadasd</td>
<td name="dsfdsfsd222222" onclick="f(this.name)">asdasd</td>
</tr>
</table>
</body>
</html> According to the standards, <td> doesn't have a 'name' attribute and neither does <tr> or <table> as a matter of fact. IE supports it, Opera doesn't, Firefox doesn't. IE is infamous of supporting non standard things.
The only thing you can do is to replace each occurrence of 'name' with 'id' attribute since each element supports the 'id' attribute.
See this example to know more:
The only thing you can do is to replace each occurrence of 'name' with 'id' attribute since each element supports the 'id' attribute.
See this example to know more:
html Syntax (Toggle Plain Text)
<html> <head> <script type="text/javascript"> function doName(name) { alert("ID: " + name.id); alert("Name: " + name.name); } </script> </head> <body> <table id="TABLE" name="TABLE" onclick="doName(this);" border="1"> <tr id="TR" name="TR" onclick="doName(this);"> <td id="TD" name="TD" onclick="doName(this);">CLICK ON ME</td> </tr> </table> </body> </html>
Last edited by ~s.o.s~ : Jul 1st, 2007 at 1:39 am.
I don't accept change. I don't deserve to live.
Happiness corrupts people.
Failing to value the lives of others cheapens your own.
Happiness corrupts people.
Failing to value the lives of others cheapens your own.
![]() |
•
•
•
•
•
•
•
•
DaniWeb JavaScript / DHTML / AJAX Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
- Visual basic Help please! (Visual Basic 4 / 5 / 6)
- :S can u (C#)
- University Logo Design Contest (Graphics and Multimedia)
- access validation (Computer Science and Software Design)
- Access 2002 (Visual Basic 4 / 5 / 6)
- How to read in a sentence and insert in to linked list? (C++)
Other Threads in the JavaScript / DHTML / AJAX Forum
- Previous Thread: javascript and css
- Next Thread: Javascript MP3 Player



Linear Mode