Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Javascript How-To
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
Javascript How-To Ask your "How do I do this with Javascript?" questions here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old November 9th, 2004, 10:46 PM
Authorized User
 
Join Date: Sep 2004
Location: , , .
Posts: 31
Thanks: 0
Thanked 0 Times in 0 Posts
Default Invoke onClick() function when body onLoad

I have a onclick event which working well in my html tag

Code:
<td id="row" onClick="showAlert(); return"></td>
When onclick, an alert message will be popup.

So, is it possible that we could invoke this onClick event without explicitly have to click on the <td> object? For instance, when the body onLoad, write something so that the <td> object will invoke the onclick event itself?

Reply With Quote
  #2 (permalink)  
Old November 10th, 2004, 02:04 AM
Friend of Wrox
 
Join Date: Oct 2004
Location: delhi, delhi, India.
Posts: 553
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to vinod_yadav1919 Send a message via Yahoo to vinod_yadav1919
Default

Hiii Muklee
Try to do this
<script>
function showAlert()
{ alert("test-muklee");
}
function test()
{
obj=document.getElementById("row")
obj.click();
}
</script>
<body onload="test()">
<table><tr>
<td id="row" onClick="showAlert();">TableData</td>
</tr>
</table>
</body>
Hope It will solve your question.
Cheers :)

vinod
Reply With Quote
  #3 (permalink)  
Old March 16th, 2007, 01:02 AM
Registered User
 
Join Date: Mar 2007
Location: , , .
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

thanks a lot it is working!!!

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
onload function calll tannu Ajax 1 November 21st, 2006 01:15 PM
Double DB insert using body.onload needlz BOOK: Professional Ajax ISBN: 978-0-471-77778-6 1 February 20th, 2006 04:18 PM
Problems with Body onload event blaabil Javascript How-To 0 January 6th, 2006 06:45 AM
How to use Onclick function for this jaya2109 BOOK: Beginning ASP 3.0 5 June 22nd, 2004 07:28 AM
Body Onload Function Question apd8x Javascript 2 July 10th, 2003 02:52 AM



All times are GMT -4. The time now is 09:14 AM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.