473,385 Members | 1,734 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,385 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 1211
<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)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.