/    Sign up×
Community /Pin to ProfileBookmark

how to get a document’s image name?

Friends,

I put this in the head

<script>
function win(){
var picname;
var imdet;
if (picname==”img1″){imdet=”test img1″}
else {if (picname==”img2″){imdet=”test img2″};};
myWindow = window.open(“”,”25″,”25″)
myWindow.document.write(imdet)
myWindow.document.bgColor=”lightblue”
myWindow.document.close()
}
</script>

In the document im having some images if a user selects image then i have display according to their selection.

<img name=”img1″ border=”0″ src=”entlevel.jpg” width=”56″ height=”100″ style=”cursor:hand” onClick=”picname=this.name;win();”>

This is not working…..May be im wrong…..
Please Correct me.

Thanks
Sathyguy

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@UltimaterSep 05.2006 — Knock off the red area.

[color=red]var[/color] picname;
×

Success!

Help @sathyguy 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 6.16,
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: @nearjob,
tipped: article
amount: 1000 SATS,

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

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...