/    Sign up×
Community /Pin to ProfileBookmark

OK/Cancel message box for <a href>

Hi all!

Does any one here know how I could make an inline javascript code to put into onclick=”” so that javascript pops up with the “OK / Cancel box” and if OK is selected, goes to the url in href=”” but if Cancel is selected just closes the box.

Is this possible?

Thanks in advance,
Magnus

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@FangNov 27.2007 — &lt;a href="home.htm" onclick="return confirm('Surf to '+this.href+' ?');"&gt;home&lt;/a&gt;
Copy linkTweet thisAlerts:
@trymbillauthorNov 27.2007 — Thanks a lot! =)
×

Success!

Help @trymbill 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.17,
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,
)...