•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the JavaScript / DHTML / AJAX section within the Web Development category of DaniWeb, a massive community of 329,811 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,854 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JavaScript / DHTML / AJAX advertiser: Lunarpages Web Hosting
Views: 29124 | Replies: 10
![]() |
•
•
Join Date: Feb 2008
Posts: 1
Reputation:
Rep Power: 0
Solved Threads: 0
•
•
•
•
actually, i think you hand in a handle to the function (not a string) and I don't think you can hand in parameters into the function. Thus, check this out to help understand how you can still pass in parameters to an onclick.
function myOnclick() {
sendingObj = event.srcElement;
alert (sendingObj.myProperty);
}
...
img.myProperty = "blahblah";
img.attachEvent("onclick", myOnclick); //notice, no brackets... no parametes, no quotes
This is correct but you can always use an annonymous function like :
img.attachEvent("onclick", function () {alert('More then one way to skin a cat')});
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
DaniWeb Marketplace (Sponsored Links)
- Previous Thread: Need to Pass Variables from form to form
- Next Thread: Draggable boxes


Linear Mode