473,480 Members | 1,943 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

IE / FF onclick behaviour and "this"

Hello World,

the code below shows 2 elements with "onClicks".

In IE all 3 values are alerted when clicking one of the elements
In FF only "this.id" is alerted on the table element and "this.id" and
"this.name" on the button element.

Is it possible to pass anything other than "this.id" (or a const
string) to a function which fired by onclick in FF?

In IE I can pass the whole object as argument: <td name="coolname"
onclick=myfunc( this );and get the values in the function: function
myfunc( Owner ) { alert( Owner.name ); } --- that can make a lot of
things very easy...

Is there a way to get something like that work on FF?

<html>
<body>

<button name="buttonName" id="buttonId"
individualattribute="individualValue" onclick="alert( this.name + '\n'
+ this.id + '\n' + this.individualattribute );">click me</button>

<table border=1 name="tableName">
<tr name="trName">
<td name="tdName" id="tdId" individualattribute="individualValue"
onclick="alert( this.name + '\n' + this.id + '\n' +
this.individualattribute );">
also 4 testing
</td>
</tr>
</table>

</body>
</html>

Jun 12 '07 #1
1 1368
Forget my last post.
switched on brain and found getAttribute....

Jun 12 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
15034
by: Mike Kamermans | last post by:
I'm trying to determine where inside an XHTML's DOM a javascript function is triggered, but when I use the construction of calling a function with "this" as parameter and then checking the event...
4
11139
by: Armel Asselin | last post by:
Hello, I'm working on a Javascript interpreter; when I execute this code I cannot figure out why the inner "c" function returns the input widget as "this"... could someone tell ?? <input...
1
1437
by: lawrence | last post by:
I'm trying to gain a better understanding of javascript by studying examples. I noticed this in an online tutorial. I don't get the use of "this". >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> You might want...
6
2146
by: Vern | last post by:
I'd like to make the following a generic method that all my forms can call to validate all the fields on the form. So how do I pass the form object that is represented as "this" in the following...
7
1992
by: Shapper | last post by:
Hello, I have an ASP:ImageButton where I want to call a function and pass a string: OnClick="Change_Photo("John")" I am having problems with "". I tried
2
4710
by: Dustin | last post by:
I found a solution to my problem in the topic called "OOP (and the XMLHttpRequest)". You may find it useful to reference to see what I have done so far. I am making a small AJAX helper object...
2
49239
kestrel
by: kestrel | last post by:
i had it a while ago, but i forgot... heres what i have.<input type="button" value="Submit" onclick="this.disabled=1; this.value=Sending;"> i can get the button to disable, but the value wont...
2
1507
by: eiselekd | last post by:
When using firefox a onclick="func(this,...)" in a <a> node will result in "this" beeing the <a> node while in IE it is the current document. Is there a way to get the <a> node in both IE and...
7
1694
by: szimek | last post by:
Hi, I've got this very simple code: <body onclick="foo(event, this)"> Inside foo method in IE "this" is body object, but in FF it's window object - at least that's what MS Script Editor and...
0
7037
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
7034
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
6732
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
5324
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4472
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
2990
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
2976
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
558
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
174
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.