Thread: onClick woes
View Single Post
  #2 (permalink)  
Old November 3rd, 2007, 01:13 PM
joefawcett's Avatar
joefawcett joefawcett is offline
Wrox Author
Points: 9,763, Level: 42
Points: 9,763, Level: 42 Points: 9,763, Level: 42 Points: 9,763, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Exeter, , United Kingdom.
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

There are a number of ways:
Code:
option2.onclick = function(){checkAnswer(this.name);};
I think that's neater or
Code:
option2.onclick = new Function("checkAnswer('" + testx + "');");
what you had but your quotes were wrong.

--

Joe (Microsoft MVP - XML)
Reply With Quote