/    Sign up×
Community /Pin to ProfileBookmark

how to pass value to a function?

hi i have a function were when you cick on image you get popup withe the name of the image id. Now I want to do the same but without clickung, but I have no Idea how? here is what i have…

[CODE]
function show(e){
alert(e.id); //outputs photo.jpg
}
<img id=photo.jpg src=lala.jpg onClick=show(this)>
[/CODE]

Now what I want to do is to add something like show(e.id=new_photo.jpg); at the end of the scpt so it would be emitating the user cliking on the image…. and still passing the image id, but I would tell the script which id to pass?

Any help?

Thanks!~

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@dknight3Aug 16.2006 — i have no idea what your trying to do, can you try to explain a little more clearly?

maybe, onmouseover="show(this);" ??
Copy linkTweet thisAlerts:
@alexusauthorAug 16.2006 — what im need is to pass the value just like if i had the objrct... but I wana do that without the object... just inoitiathe the function and send the "fake" value to it?

im I more clear now?
×

Success!

Help @alexus spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.19,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...