Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

row.onClick="alert()" when building table using javascript

Posted on 2004-10-26
4
Medium Priority
?
988 Views
Last Modified: 2012-05-05
var row = table.insertRow(0);
row.className = "lb"
row.vAlign="top"
row.onClick="alert()"

i'm trying to modify a table and include an onClick event handler, as far as i can tell this should work

any ideas
0
Comment
Question by:steve_steele
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 6

Expert Comment

by:boblah
ID: 12411557
Hi steve_steele,

try

row.onClick=function(){alert();}


Cheers!
0
 
LVL 6

Expert Comment

by:boblah
ID: 12411572
steve_steele,

or, if you want to make use of the event arguments:

row.onClick=function(e){alert();}
0
 
LVL 13

Accepted Solution

by:
cLFlaVA earned 2000 total points
ID: 12411596
Just a suggestion:

You should use the all-lowercase versions of the event handlers:

row.onclick = function() {alert();}
0
 

Author Comment

by:steve_steele
ID: 12411924
that sorted it thank you very much
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In my daily work (mainly using ASP.net), I need to write a lot of JavaScript code. One of the most repetitive tasks I do are the jQuery Ajax calls. You know: (CODE) I don't know if for you it's the same, but for me is soooo tedious to write the …
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

604 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question