...

View Full Version : alert when a user click a link



joonstar
08-29-2004, 09:38 AM
index.html
<a href="next.html" name="DoNotClick"> click </a>



I have a link like the above.

If a user clicks the link, it will move to next.html.

But I like to make it like the following.

If a user click the link, it will show an alert saying "Do not click, please," and
as the user confirms the alert, it will back to index.html.

Thanks in Advance

dumpfi
08-29-2004, 10:52 AM
document.onclick = no_click;
function no_click(e) {
var target = (typeof(e) != 'undefined') ? e.target : window.event.srcElement;
if(target.name == 'DoNotClick') {
alert('Do not click, please');
return false;
}
return true;
}
dumpfi

Roy Sinclair
08-30-2004, 08:28 PM
If you don't mind my asking: "What purpose could this serve?" Are you researching human behavior or something?

Philip M
08-31-2004, 08:35 AM
Give my greedy up

Is that not clear, Roy?

jamescover
08-31-2004, 10:46 AM
If you don't mind my asking: "What purpose could this serve?" Are you researching human behavior or something?

Too hilarious. :eek:


How about:



<a href="index.html" onmouseover="javascript:alert('Get Lost Punk!');">Link</a>



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum