473,406 Members | 2,843 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,406 software developers and data experts.

Multiple attributes

What happens when there are multiple onclick attributes on a single
tag:

<input type="radio" onclick="alert('first')" onclick="alert('second')">

On Firefox and IE6, only the first is executed. Is this what will
happen consistently across browsers?

Brian

Jul 26 '06 #1
3 1212
<br**********@gmail.comwrote ...
On Firefox and IE6, only the first is executed. Is this what will
happen consistently across browsers?
I think so, but can't you just put the calls in the same onclick event? ie,

<input type="radio" onclick="alert('first'); alert('second')">

?

Regards

Rob
Jul 26 '06 #2
br**********@gmail.com said the following on 7/26/2006 6:15 PM:
What happens when there are multiple onclick attributes on a single
tag:

<input type="radio" onclick="alert('first')" onclick="alert('second')">

On Firefox and IE6, only the first is executed. Is this what will
happen consistently across browsers?
Probably, probably not. It would be a guess. But, why do you want
multiples? It is far more reliable to combine them into one and you get
consistent behavior among browsers:

onclick="alert('first');alert('second')"

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Jul 27 '06 #3
Probably, probably not. It would be a guess. But, why do you want
multiples? It is far more reliable to combine them into one and you get
consistent behavior among browsers:
Yes, I completely agree. I have some code with tags that by mistake
have two onclick events--the first one intentionally there, the second
one there by mistake--and I'm wondering if the first onclick event has
failed to execute on some browsers when this code was run in the past.
Does anyone know the behavior of this on Safari?

Brian

Jul 27 '06 #4

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

Similar topics

1
by: DraguVaso | last post by:
Hi, I found some examples for storing the FormSettings of a Form in an XML-file, but none of these could match my criteria: What I am looking for is the possibility to save the FormSettings of...
19
by: Steve Jorgensen | last post by:
I've run across this issue several times of late, and I've never come up with a satisfactory answer to the best way to handle this schema issue. You have a large section of schema in which a...
1
by: darrel | last post by:
On some of my pages I add a javascript call dynamically to the BODY tag: pageBody.Attributes.add("onload", "dothis();") Since this adds an actual attribute, trying to call this multiple times...
1
by: puneet.bansal | last post by:
Hi, I want to know the index of the option that a user clicks on in a multiple-select object (regardless of whether he selected or deselected it). This seems fairly simple but I can't seem to...
2
by: Diego | last post by:
Hi everybody! I'm using DB2 PE v8.2.3 for linux. I've defined a database with the following schema: ANNOTATION(ID,AUTHOR,TEXT) ANNOTATION_BOOK(ANNOTATION_ID,OBJECT_ID)...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
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:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.